Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14

    Search query problem - not returning a value

    The database is functioning OK (tables, forms and reports). I have one master table and 10 other tables that the master table uses for a lookup. The problem is with the search query that I have set up.

    From the Query – Design I added the following string in the Criteria fields for each column:

    LIKE “*” & [forms]![searchF]![Songs] & “*”

    Where, search is the search form and Songs is the Column name.
    When I run the query on the first column (Songs) it works perfectly, but when I run the query on any other column it does not return a value. I know that my criteria is set up properly, so I am assuming that the problem lies with the other tables being a lookup for the master table… maybe the relationships between all the tables??? Just don’t know. Any help?



    Allyn

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    If I am reading this correctly. You should not need your criteria in any column of the query but the song column.
    You are telling the query to filter by Song.

    Song is not in the other fields is it.?

    Dale

  3. #3
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    Dale... thanks for the reply. I want to be able to search by the other columns (composer, publisher, genre, theme, etc). I might search for a song by, say... composer = Bach and publisher = Rutter Music Productions. I want to display all songs that meet the criteria. BTW, the master table is called Songs.

    Allyn

  4. #4
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    OK. I think I understand.
    If you put your filter criteria all on the same line the query looks at it as an "AND".
    meaning that ALL criteria must be met.
    Try putting each criteria on a separate line in your query.
    The query then looks at it as an "OR" .
    Meaning that if any one of the criteria is met filter by that.

    Dale

  5. #5
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    Thanks Dale... I gave it a try and still no returned values for criteria other than if I search on Song and no other column.

    I appreciate your kind help... Allyn

  6. #6
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Strange.
    I thought for sure that would do it.

    I will give it some more thought.
    Dale

    Edit: You will only be able to use 1 criteria at a time this way.
    Are you trying it with more than one?

  7. #7
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    Yes... I need to search by more than one criteria. Here is a link to a You Tube tech article describing this search query.

    http://www.youtube.com/watch?v=CTiA_4Me0cI

  8. #8
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    I look at the Utube.
    I see the problem.
    Put all of the criteria back on the same line.
    AND change the field name in each criteria to the field name of the query.

    Like change song to composer for the composer field.

    Dale

  9. #9
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    Dale... thanks for the fix. My boss just dumped a project on my lap, so I won't be able to test until later this evening. I'll let you know. Thanks so much for your patience!

    Allyn

  10. #10
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Glad to help.
    Sorry I am so slow.
    Still a newbie here.

    Dale

  11. #11
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    Well... the problem lies elsewhere. I have modified the criteria with the field name for each column. Using the search query on the primary column (Songs) works perfectly, but all other fields do not return a value. I followed the video carefully. I wonder if it has something to do with the relationships between the master table and the other tables.

    Allyn

  12. #12
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    One last thing.
    Check to see that your text box names from the form are the names in the criteria in the query.


    Dale

  13. #13
    aeaster is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    14
    yep! all good there. Guess I'll need to try to contact the author of the video for explanation.

    Thanks,
    Allyn

  14. #14
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    There is data in the other fields, correct.
    You have tried using just one of the other combo boxes by itself correct.

    Strange
    I will ponder some more.
    If you did not have a 64 bit Access I would look at your database.
    Dale

  15. #15
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    OK, I re-read your posts.
    I do not think your query is correct.
    10 tables is a lot of tables to put into 1 query and have it work.
    Take a very good look at your tables and make sure they are normalized well.

    What I think may be happening is that the joins in your query are not correct to show the data you want.


    Dale

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query not returning records
    By Daryl2106 in forum Access
    Replies: 2
    Last Post: 11-28-2012, 09:29 AM
  2. Replies: 13
    Last Post: 11-08-2012, 03:49 PM
  3. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  4. Query - Returning ID instead of Value...??
    By Poolio in forum Queries
    Replies: 5
    Last Post: 04-18-2011, 07:10 AM
  5. Returning inverse of a query
    By caddcop in forum Queries
    Replies: 5
    Last Post: 02-16-2011, 04:48 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