Results 1 to 4 of 4
  1. #1
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98

    Query not using Search Criteria

    Greetings all,

    I'm having some issues with a couple of my Queries.
    Here is the info:
    User clicks on button to search the Misc. Inventory, so button calls Misc_Inv_SearchQ and then throws the results from the Query to a Report form.
    However, when you type in the description to search for in the form, the Query doesn't seems to give a rats ass. It either never shows anything on the Report page, or it will show EVERYTHING in the Misc category.

    Here are my Query search criteria strings:
    Code:
    Like '*' & [Forms]![Misc_SearchF]![DescriptionBox] & '*'
    Like '*' & [Forms]![Misc_SearchF]![DescriptionBox] & '*'
    Like '*' & [Forms]![Misc_SearchF]![PartNumberBox] & '*'
    I've tried putting these 3 strings in the Criteria section with no reference to the Model field (The Model field in this case will be Misc)
    I've also tried putting these 3 strings not only in the Criteria fields, but also in the OR: fields to see if that would help the search in determining between each of them... still no joy.



    If I add ="Misc" in the Model field, then it will list every single item in table that has the Model field. (BTW: I have numerous fields for Model which I use to differentiate between the types of equipment in the entire Table)

    So, for some reason, my queries don't seem to care about my actual search criteria. I'm wondering why.

    Any advice would be greatly appreciated.
    Regards.

  2. #2
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Update:
    Ok, so I've removed 2 of the 3 search criteria strings, leaving only the Description search criteria.
    This seems to work. However, if/when I add in the Serial number &/or the Part number search criteria, I get nothing but a blank Report.

    I'm not certain what is causing this. Access if flaky like this. Every so often, things just break for no reason. It will work fine, and then all of a sudden a query doesn't run, or a report will be all fubar. I don't know why this happens, especially since nobody is editing the database, so there should be no reason for these type of intermittent glitches.

    I have other Queries with multiple criteria options and they all seem to work perfectly fine. Every so often, I have to just nuke a query and re-do it from scratch and it will work for some strange reason... however, I refuse to be beholden to this type of glitch so I'm determined to find out why this happens and put a stop to it.

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Is it possible you could upload a sample database with sensative data removed?

  4. #4
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    Can you put up a picture of the query in the query editor, I'm really struggling to understand your description I'm afraid.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Query not using Search Criteria
    By FriQenstein in forum Queries
    Replies: 3
    Last Post: 01-22-2019, 08:05 AM
  2. Replies: 13
    Last Post: 08-16-2017, 01:36 PM
  3. Multi Search Criteria Form/Query
    By NickWren in forum Access
    Replies: 4
    Last Post: 10-04-2016, 05:42 PM
  4. Help on query criteria for a search
    By urbanhawk in forum Queries
    Replies: 3
    Last Post: 01-31-2014, 04:42 PM
  5. Replies: 9
    Last Post: 05-05-2011, 02:05 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