Results 1 to 3 of 3
  1. #1
    Alsail77 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    17

    Query with dropdown box

    I have a query which pulls its parameters from a Form [Main] to preform a search. One of the fields the query searches by is a Combo Box/Dropdown list [Combo94]. All Records have five possible results for this field (call them "A"-"E" to make it easy).




    I want to make it so that when performing the search the user can either, select one of the five options (A-E), or they can select a sixth option "All", which will select all records (effectivly ignore this criteria). Currently I have the criteria set to [Forms]![Main]![Combo94] which obviously works when options A-E are used.

    If it makes a difference, this query runs a search on five other fields at the same time.

    Thanks,
    Alex

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If you want to accomplish with only the simplest VBA code, review this method http://datapigtechnologies.com/flash...tomfilter.html

    With this technique, the sixth option would be an empty string from the list or just leave the box blank, not the word 'All'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Alsail77 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    17
    Thanks, June7. I managed to implement that with ease. I was stuck on thinking "All" was an important option for the user to see and failed to think of leaving it blank as an option.

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

Similar Threads

  1. Search Query within Dropdown Question
    By Scyclone in forum Programming
    Replies: 12
    Last Post: 10-11-2011, 10:53 AM
  2. Replies: 9
    Last Post: 05-23-2011, 06:12 PM
  3. Set up a dropdown List
    By asherbear in forum Access
    Replies: 2
    Last Post: 06-24-2010, 06:45 AM
  4. Dropdown list in a query
    By asherbear in forum Queries
    Replies: 6
    Last Post: 05-31-2010, 06:38 PM
  5. Dropdown - need help please
    By sullyman in forum Access
    Replies: 8
    Last Post: 10-26-2009, 07:48 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