Results 1 to 10 of 10
  1. #1
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6

    Query the Same Table Twice

    I am making a candy database for a class, and I have one table that contains the composition of each candy next to the candy_ID and the corresponding composition_ID. For something like snickers, there will be duplicate candy_IDs for each composition_ID. So if snickers was candy_ID #37, it would be peanut; #37 & in the next row, nougat; #37. The trouble when I link everything together in access is that I can only search for one composition at a time. I can find all the candy that has nougat or peanut. If I put two compositions side-by-side in a search for "peanut" and "nougat" it gives me nothing. If I put "peanut" below "nougat" in a composition search column, it gives me "nougat" or "peanut." Is there a way I can search both? Perhaps it is flawed how I have organized the raw data.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847

  3. #3
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6
    Thank you, but I still need to figure out how to reformat my tables to make this work.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    I don't have acc2010 so can not open accdb files.

    Can you post a picture of your tables and relationships?

  5. #5
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6
    Sorry I am struggling to fit pictures of the right size in this size limit.

  6. #6
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6

  7. #7
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6
    Ok, apparently I can't post pictures in here.
    One table would be:
    Composition_ID;Composition;Candy_ID
    1 Chocolate 1
    2 Caramel 1
    3 Rice 1
    and the main other table would be:
    Name ; Candy_ID
    100 Grand Bar 1

    The two would be linked by Candy_ID, and the tables are much longer, so other things contain rice, caramel, and chocolate, but this is the only one that contains all three (or possibly the only one that has rice and caramel).

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    You might want to look at this
    http://support.microsoft.com/kb/283878

  9. #9
    MrSquigglesworth is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    6
    Still can't figure it out. I am getting Expr1000 when I try to access a table for two things. I have read other forums where this has occured http://help.lockergnome.com/office2/...pict90840.html and http://www.ozgrid.com/forum/showthre...t=52032&page=1, but with no solution that works. Anyone know of any work arounds?

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    By default, when you create a query via the Query Wizard that involves calculations, M$oft will assign a variable name like Expr1000.

    If you could show the query, I'm sure someone could help.

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

Similar Threads

  1. Insert query into table FROM two table sources
    By svcghost in forum Queries
    Replies: 2
    Last Post: 11-05-2010, 09:10 AM
  2. Replies: 1
    Last Post: 07-30-2010, 10:28 AM
  3. Replies: 2
    Last Post: 03-14-2010, 07:27 PM
  4. Replies: 0
    Last Post: 02-24-2010, 12:56 AM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 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