Results 1 to 4 of 4
  1. #1
    hlm15 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    3

    Creating a simple query?

    Hi, I have a quick question about setting up a query. I understand how to set up a query have managed to get them to work using related and junction table. The problem arises, however, when I try and set up a query using a single table. My database records information about French songs. In my child table (the song table) I am trying to set up a query to list all French songs which use a diminished chord. I have selected the fields which I want the query to display and under the field 'chord' I have set the criteria as "diminished". When I press run, however, the datasheet view is empty and no results are displayed. A similar thing happens when I try and set up a query for finding all the songs composed for a particular instrument. I have managed to the get the query to work for my parent tables so I don't really understand why I can't seem to get it to work for the child table.



    Is anyone able to shed light on why this might be?
    Thanks for your help in advance

  2. #2
    jwreding is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    34
    It's hard to figure out exactly what issue you're having without seeing a screenshot of your query, or uploading a file. Of course, I am no expert either, so maybe someone else can provide a quick solution.

    You do have a relationship between your parent and child tables, correct? If so, do you have both tables showing in your query builder?

    Again, seeing how your tables are organized would really help toward solving the problem.

  3. #3
    hlm15 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    3
    Hi, Thanks for your quick reply. I think the relationships are set up correctly. The actual field (in this case the chord field) that I am searching isn't linked to another table though. Do I need to? Would setting up a junction table solve the problem?

    I have attached screenshots of the table, relationship window,the query and the query results. As this is original research I can't attach the actual database, but hopefully the example I've given will give an idea of what I am trying to achieve.
    Thanks for your help.

  4. #4
    jwreding is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    34
    First of all, I'll give you the standard advice that most experts (which I am not) give to new Access users. You'll want to do some research on normalization.

    For example, you should have just one Songs table, not different tables based on the type or era of song. Any time there is a trait of a larger category, that should be expressed as a field in a table, not as a completely separate table unless you have really good reason.

    Also, use the ID fields for just that...IDs. In the Publisher field, you seem to have the full name of the publisher. There is no need for that, because you can link it to the ID field of the Publishers table, where it appears you have a FirmName field.

    Take all of this advice with a grain of salt, though. If your database is going to remain very small in scope and used for only one specific purpose, probably no need to spend the time going back and doing the work to normalize. However, if you plan on making more databases in the future, you should become familiar with these best practices.

    To answer your original question...you have the query pretty much set up correctly. The problem is you are trying to return all UnusualChord values that match "diminished." Looking at the data, it seems as if you want to get all values that contain the word diminished. Change your criteria to the following:

    Like "*diminished*"

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

Similar Threads

  1. Creating a simple report?
    By berni3883 in forum Reports
    Replies: 1
    Last Post: 03-29-2011, 12:31 PM
  2. Replies: 1
    Last Post: 01-20-2011, 11:23 AM
  3. Simple query help
    By Subhunter in forum Queries
    Replies: 9
    Last Post: 11-19-2010, 03:32 PM
  4. Creating a simple filter
    By Kipster1203 in forum Reports
    Replies: 3
    Last Post: 05-18-2010, 10:00 AM
  5. simple query
    By taylorosso in forum Queries
    Replies: 1
    Last Post: 10-06-2009, 04:26 AM

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