Results 1 to 7 of 7
  1. #1
    Jrw76 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2013
    Posts
    38

    query criteria

    I'm overlooking something. I'm just running a simple query where I have the criteria to a field named category set to "PIPE". I know that I have LOTS of records where PIPE is entered, however, my query is not returning any records. What am I not seeing? Any ideas?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Try:

    like *pipe*

  3. #3
    Jrw76 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2013
    Posts
    38
    That didn't work...It's not a lower case issue. I think it has something to do with the lookup, but don't know what. I have a drop down menu in table one that has has a list from table two...that list is PIPE, HULL, HVAC, and ELECTRICAL. I need to make a report where CATEGORY is equal to "PIPE".

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    are you storing the actual text 'pipe' on your table or a FK to another table where the description is actually being stored? if it's linked to another table and you ARE storing the FK you have two options link in that secondary table and then put the PIPE criteria on that descriptor field. If you are attempting to run this query from a form or something like that you can also have a combo box that shows the items you listed (again assuming the table structure is two tables linked via pk/fk) then put in a criteria referencing the combo box like this:

    [forms]![formname]![searchfieldname]

    where formname and searchfield name would be the form the combo box is on and searchfieldname would be the combo box name itself.

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    p.s. lower case has nothing to do with text string searches. Unless you go to pains to prevent it

    Pipe
    pipe
    PIPE
    pIPE
    PiPE

    etc are all the same if you search for PIPE

  6. #6
    Jrw76 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2013
    Posts
    38
    I have a table for category...the fields are ID and Name. I have four entries; PIPE, HULL, HVAC and ELECTRICAL. I have another table that holds all the data. One of the fields is 'Name' which is a drop down box that user selects either PIPE, HULL, HVAC or ELECTRICAL. I created a query from the table that holds the data where one of the fields is 'Name' and the criteria is PIPE.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    so you got it working as you wanted?

    just as an aside you shouldn't use reserved words in your field names. NAME is a reserved word in access and may cause you problems in the future, you might want to consider changing it to 'CAT_NAME' or something similar.

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

Similar Threads

  1. Replies: 4
    Last Post: 05-02-2013, 11:07 AM
  2. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  3. Replies: 5
    Last Post: 09-20-2012, 03:27 PM
  4. Replies: 5
    Last Post: 08-02-2012, 09:44 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