Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Thanked 0 Times in 0 Posts

    Query by Form (Access 2000)

    I've got a database that tracks literature by various people in the company. I've got a form that allows a user to search the db by entering criteria into the form which feeds the info into a query and it returns the corresponding newsletter.

    The "search" form contains 5 fields that a user could search by from author to date to topic to office location to state. The code for my query has 32 OR statements in the Where clause to capture every combination they could search by. It's monsterous and ugly. If they request another field to search by that creates 64 combinations of search criteria.

    Is there an easier way to write the Where clause so that my query can be flexible enough to query by author and topic one time with the other fields Null and then query by date and office location the next time without writing code for each search combination? Thanks for any help.


  2. #2
    4 Star Lounger
    Join Date
    Dec 2002
    Kitchener, Ontario, Canada
    Thanked 0 Times in 0 Posts

    Re: Query by Form (Access 2000)

    (Edited by HansV to activate link to MSKB article)

    This MS Knowledge Base article will give you one solution: <!mskb=262099>Microsoft Knowledge Base Article 262099<!/mskb>

    Peter N

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts