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

    Query Criteria Error

    Hi All,



    I have a form with 4 combo boxes so I can search a certain criteria.

    I have research this and have been using this

    [Forms]![Search]![Combo11] Or [Forms]![Search]![Combo11] Is Null

    This work absolutely fine for a few times.

    Then all of a sudden it got buggy and change all the criteria lines and looked horrible.

    Please tell me there is something simple that I have done wrong!

    Please see attachment images to understand.Click image for larger version. 

Name:	Query Criteria Before Error.PNG 
Views:	6 
Size:	13.9 KB 
ID:	9158Click image for larger version. 

Name:	Query Criteria Error.PNG 
Views:	6 
Size:	17.2 KB 
ID:	9159

  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
    The criteria doesn't make sense. It translates to: Find records where ([Week Number] equals Combo13 or [Week Number] equals Combo13 is null) and ([Project Name] equals Combo11 or [Project Name] equals Combo11 is null)

    What you might be trying to do is: Find records where ([Week Number] equals Combo13 or [Week Number] is null) and ([Project Name] equals Combo11 or [Project Name] is null)

    Are these two fields allowed to be blank (no data)?

    Review http://datapigtechnologies.com/flash...tomfilter.html
    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
    AndreasPanayiotou is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    21
    Hello birth19,
    I am familiar with your issue , its not your fault but access here is the solution .
    As i understand this is a search query .
    What you should do i recomment that you manual write the query inside the SQL Query , then save it .
    These changes when your in the sql query mode , then go to the design view and then back to the SQL Query Mode .
    Or if your in the sql query mode then Design view and you run the query from the design view .
    I am not sure why and how but access mess it up. So be sure when your changing from SQL Query to Design view dont save the changes and your code will be OK .

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

Similar Threads

  1. Replies: 5
    Last Post: 09-20-2012, 03:27 PM
  2. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  3. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  4. Query Criteria Causing Data Mismatch Error
    By jrubenol in forum Queries
    Replies: 2
    Last Post: 09-14-2011, 09:34 AM
  5. Replies: 1
    Last Post: 07-13-2011, 11:00 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