DoCmd.OpenForm Statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nothing

    DoCmd.OpenForm Statement

    I have a form that the user types in a last name to search for then
    clicks a search button.

    Based on the information I want to open the form using the SQL Where
    statement that will pattern match on the user input.

    For example if the user enters char I want to the form to open with all
    records based on char in the corrent field.

    I can get the form to open fine if I type in a whole last name, it will
    retreive the records but I can not get the LIKE statement in the SQL
    Where part of the open form statement. Does that make sense?

    Anyone have any ideas?

    Michael Charney

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Allen Browne

    #2
    Re: DoCmd.OpenForm Statement


    DoCmd.OpenForm "Form1", WhereCondition: = "[corrent] Like """ & [Text1] &
    "*"""

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Nothing" <me@you.com> wrote in message
    news:41a55797$0 $14555$c397aba@ news.newsgroups .ws...[color=blue]
    >I have a form that the user types in a last name to search for then
    > clicks a search button.
    >
    > Based on the information I want to open the form using the SQL Where
    > statement that will pattern match on the user input.
    >
    > For example if the user enters char I want to the form to open with all
    > records based on char in the corrent field.
    >
    > I can get the form to open fine if I type in a whole last name, it will
    > retreive the records but I can not get the LIKE statement in the SQL
    > Where part of the open form statement. Does that make sense?
    >
    > Anyone have any ideas?
    >
    > Michael Charney[/color]


    Comment

    Working...