Results 1 to 3 of 3
  1. #1
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78

    Question Multiple options for query criteria

    I have a form with three combo boxes that I want to use for sorting my data. The user has the option of filing in anyone of the three boxes, I plan on disabling the other two boxes if one has already been selected. Since the combo box category will vary, I wanted to have in my query a criteria expression in each of those respective fields. When I run the query with just one criteria expression I receive my results but when I add in the additional criteria I naturally receive nothing. Whats the solution here? thanks again!

  2. #2
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    In your criteria you can use "[Form]![FieldName] OR [Form]!FieldName] Is Null"

    That will search for what you typed in that field or if if it's null it will basically ignore it as criteria.

  3. #3
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Quote Originally Posted by Xipooo View Post
    In your criteria you can use "[Form]![FieldName] OR [Form]!FieldName] Is Null"

    That will search for what you typed in that field or if if it's null it will basically ignore it as criteria.
    Similar to the process I used, it returns data when I apply the expression to one criteria, but when I enter this code in each of the three criteria fields of my query at once, I get nothing back. Any way you know to combine this in a query or am I better off using VBA code in a click event that launches a report with the filtered information?

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

Similar Threads

  1. Replies: 5
    Last Post: 11-26-2013, 07:24 PM
  2. Replies: 2
    Last Post: 04-10-2013, 03:54 PM
  3. Replies: 7
    Last Post: 01-02-2013, 11:23 PM
  4. Replies: 1
    Last Post: 07-13-2011, 11:00 AM
  5. Multiple filtering options in vba
    By eww in forum Programming
    Replies: 2
    Last Post: 09-28-2010, 01:46 PM

Tags for this Thread

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