Results 1 to 3 of 3
  1. #1
    tigers is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2006
    Posts
    28

    Telling Query to Pull All Records by Combo Box

    I have a combo box that I have set up that contains a list of things. I want to tell the query that when the combo box is blank, to pull all of the records (essentially leaving my criteria blank in the query). I can't get it to work. I can get the query to run properly based on the ONE selection in the combo box but I can't get it to recognize that if the combo box is blank, to pull all records. In general, I'm using an if-then statement like this:



    iif(form_combobox = null," ",form_combobox)

    or

    iif(form_combobox = " "," ", form_combobox)

    Any suggestions? I don't know Sequel and I am running Access 2002.

    Thanks!

  2. #2
    tigers is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2006
    Posts
    28

    Answer

    I got it figured out on another board. Should have been using "Or" instead of if/then:

    Forms![NameOfForm]![NameOfCombobox] OR (Forms![NameOfForm]![NameOfCombobox] IS NULL)

  3. #3
    jagall is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    1
    Quote Originally Posted by tigers View Post
    I got it figured out on another board. Should have been using "Or" instead of if/then:

    Forms![NameOfForm]![NameOfCombobox] OR (Forms![NameOfForm]![NameOfCombobox] IS NULL)
    Thanks for adding solution.

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

Similar Threads

  1. Recalling Records from a Combo search
    By Dreamcatcher in forum Forms
    Replies: 0
    Last Post: 08-18-2008, 07:33 AM
  2. Replies: 1
    Last Post: 02-14-2007, 07:27 PM
  3. Replies: 0
    Last Post: 12-19-2006, 09:44 PM
  4. Telling forms where to go
    By kfinpgh in forum Forms
    Replies: 0
    Last Post: 10-10-2006, 12:51 PM
  5. Add combo box to parameter query
    By louisa14 in forum Queries
    Replies: 1
    Last Post: 12-10-2005, 08:38 AM

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