Results 1 to 2 of 2

Thread: Query Question, Wildcard Value??

  1. #1
    Join Date
    Jun 2005
    Posts
    9

    Query Question, Wildcard Value??

    Hello,
    I have built a database for my company and have hit a small roadblock allong the way. I am using MS access 2000. I am trying to make a form with 6 drop-down-boxes that corespond to 6 different fields. The user should be able to use the drop-down-boxes to define his search and then click a run query button which will run a macro that executes the query and returns the information. I have all of this running but am having a problem with null inputs.
    The database contains testing data for some reasearch we are doing and contains Tests, Samples, Materials, and Counters tables. The form allows you to query by TestID, SampleID, MaterialID, Counter Used, Material Manufacturer, and Lot#. My problem comes when I want to search for say, all the tests on Sample 7 with Counter C. If I set up my query with the fields defined on an OR basis. It will return all tests on sample 7 as well as all tests run on Counter C, but I only want records for tests on sample 7 using counter C.
    If I set up my query to search on an AND basis the only way to return a result is to define all fields, but I need to make it so I can define only one or two fields and return all results. If the drop-down-box is left empty the program searches that field for only empty values. So I guess what I'm looking for is some sort of wildcard value that could be used as the default if the field was undefined so that my search would be something like, "return all records using Sample 7, Counter C, wildcard, wildcard, wildcard, wildcard." Does such a function exist, or does anyone know any ways around this problem.
    Thanks
    Shea

  2. #2
    Join Date
    Feb 2003
    Posts
    1,048
    Answered in the "Ask An Expert" forum. Please post your questions in only 1 forum.

    Thanks!!

Posting Permissions

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