Results 1 to 4 of 4
  1. #1
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18

    Multiple Query on Form using dropdown boxes


    Ok, here's what I have and what I want to do. I have created a form that has 3 dropboxes and a date range query. Individually they work just fine. I used the "or Like" "Is Null" in order to skip the fields that are blank, but when I put in more than one criteria, it doesn't work properly. For instance, in one dropdown box I select "A" and in another dropdown box I select "2013-10". I get all the results for "A" and all the results for "2013-10" but what I want is only the records that are BOTH "A" and "2013-10". How do I do this? I read somewhere about the AND function but I don't know how or where to use that. Can someone please help? This is the last step of my journey with this database and I would love to get it compeleted. Thank you!

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    In a query, when you add criteria for different fields on the same row line that is processed as an AND.
    Putting the criteria on different row lines is an OR

    The AND and the OR word is not needed unless you are writing inf SQL mode.

    Post you row Source for the combo boxes. Usually you can use a WHERE clause there to do the same thing easier.

    Dale

  3. #3
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18
    What do mean Post Row Source for combo Boxes? I have an employee combox that the row source is the Employee Table, a unit combobox that has a row source of select values that I typed in (A, B, C, etc.), a Pay Period combobox that has a row source of the Pay Period Table. How does a WHERE clause work?
    Thanks :-)

  4. #4
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    There maybe several ways to do this.
    Build a query with the tables you need.
    Under the fields you want to constrict or filter add, Forms!yourFormName!ControlName

    Change yourFormName to the form you are using and the control name to the combo box name. (get this from the property sheet, other tab)
    Put this criteria on the same row in the fields you want to filter. Should be on 3 fields.

    Post back if this does not work.

    Dale

    EDIT:
    the unit combo box will not work with this.
    When you open the combo box you now see A B C.... or do you see
    A
    B
    C

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Query from Multiple List Boxes
    By Gee in forum Access
    Replies: 1
    Last Post: 02-14-2013, 10:42 PM
  3. Replies: 11
    Last Post: 05-28-2012, 05:47 AM
  4. Replies: 8
    Last Post: 05-16-2012, 09:30 AM
  5. Creating dropdown boxes
    By jessbrooks79 in forum Database Design
    Replies: 5
    Last Post: 04-17-2011, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums