Search form in access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • purab
    New Member
    • Mar 2008
    • 1

    Search form in access

    I have built a search form in access and it has 4 combo boxes. I am trying to write a syntax so that if a combo box has no criteria is shows all records. For example, if a user has a following search terms:

    Author:
    Industry: Financial
    Source Type: Analyst reports

    To make this clear the "author" combo box in blank and therefore it should display results based on the other 2 parameters. Does any one know how to make this work. Let me know. Thanks
  • JustJim
    Recognized Expert Contributor
    • May 2007
    • 407

    #2
    Originally posted by purab
    I have built a search form in access and it has 4 combo boxes. I am trying to write a syntax so that if a combo box has no criteria is shows all records. For example, if a user has a following search terms:

    Author:
    Industry: Financial
    Source Type: Analyst reports

    To make this clear the "author" combo box in blank and therefore it should display results based on the other 2 parameters. Does any one know how to make this work. Let me know. Thanks
    Hi,
    I'm presuming that you are doing this in code.

    DIM string variables for each of the combo box values and concatenate the variables into a search string. That way if the value of a combo box is null, that part of the search string will be the empty string ("").

    If that isn't clear, post again and I'll give you a code example.

    Jim

    Comment

    Working...