Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9

    Need help defining the relationship

    Hi all!

    I'm currently working on an Access project that I need to finish by tomorrow. I have never got an Access project and have never used one before. I am pretty sure the issue that I am having here is a fairly easy one for experienced people out there.

    I currently have 2 tables. The first one is a table with 15 fields in it. The second one has 5 fields.


    The first and second table have information about account name and account ID.

    The second one has information about account description that the first one doesn't have.

    What I am trying to do is to create a new field on the first table for account description according to the information provided on the second table. Each account description will be different according to the account name and account ID.

    How do you do that though? I am thinking it would be through the lookup function or relationship function but I am just not sure how!

    Thanks for your help!
    Last edited by RuralGuy; 08-27-2012 at 12:37 PM. Reason: Changed title.

  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,848
    Help! Urgent! is not the way to get an answer to your problem.

    Give your post a meaningful title - to give people some idea of what the post is about.
    Tell us the layout of your tables.

    Working on a project today that is due tomorrow doesn't give us any idea of what you have tried; what errors you have encountered etc.
    What is causing the urgency?

    I have never heard of relationship function - could you please tell us what you found?

    You might try google Adding a field to an MS Access table

    http://bit.ly/Pnf8jG

  3. #3
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    Hi orange,

    The problem I'm having is pretty much like the link below:

    http://www.access-programmers.co.uk/forums/archive/index.php/t-95436.html


    I am very new in Access and I would be very grateful if anyone here could provide me a step by step guidance. Thanks!

    Quote Originally Posted by orange View Post
    Help! Urgent! is not the way to get an answer to your problem.

    Give your post a meaningful title - to give people some idea of what the post is about.
    Tell us the layout of your tables.

    Working on a project today that is due tomorrow doesn't give us any idea of what you have tried; what errors you have encountered etc.
    What is causing the urgency?

    I have never heard of relationship function - could you please tell us what you found?

    You might try google Adding a field to an MS Access table

    http://bit.ly/Pnf8jG

  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,848
    I hate to be negative, but in the post you referenced -- no one, not the original poster nor the responders bothered to state the problem.
    If you're looking for vlookup concept then

    check https://www.accessforums.net/access/...cel-27681.html

    If that doesn't help then please state exactly what you want to do.
    Use some data to show the before and after you have and want.

  5. #5
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    So,

    This is an example. I have 2 tables.

    First table has these fields (around 10): Account ID, Employee ID, etc
    Second table has these fields: Account ID, Employee ID, and Commission ID

    Both tables have the following fields: Account ID and Employee ID.

    But only the second table has the Commission ID information...

    What I am trying to do is to pull the Commission ID data from the second table to the first table. The Commission ID will vary according to the Account ID and Employee ID.

    How do I do that? People say I would need to use queries, dlookup, sql, etc but I am very new in Access and I just don't know how.

    Thanks!

    Quote Originally Posted by orange View Post
    I hate to be negative, but in the post you referenced -- no one, not the original poster nor the responders bothered to state the problem.
    If you're looking for vlookup concept then

    check https://www.accessforums.net/access/...cel-27681.html

    If that doesn't help then please state exactly what you want to do.
    Use some data to show the before and after you have and want.

  6. #6
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    So the end result would be all fields in the first table PLUS commission ID (according to the Account ID and Employee ID) from the second table....

    Quote Originally Posted by ewong View Post
    So,

    This is an example. I have 2 tables.

    First table has these fields (around 10): Account ID, Employee ID, etc
    Second table has these fields: Account ID, Employee ID, and Commission ID

    Both tables have the following fields: Account ID and Employee ID.

    But only the second table has the Commission ID information...

    What I am trying to do is to pull the Commission ID data from the second table to the first table. The Commission ID will vary according to the Account ID and Employee ID.

    How do I do that? People say I would need to use queries, dlookup, sql, etc but I am very new in Access and I just don't know how.

    Thanks!

  7. #7
    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,848
    I think this should work but have not tested it.

    SELECT Table1.*
    , Table2.CommissionID
    FROM
    Table1 InnerJoin Table2 On
    Table1.AccountId = Table2.AccountId AND
    Table1.EmployeeId = Table2.EmployeeId;

  8. #8
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    It doesn't seem to be working. It's generating an error code when I try to run it. This is what I typed:

    SELECT Jul'12AllAccnt(FUN).*
    , Commissions.CommissionID
    FROM
    Jul'12AllAccnt(FUN) InnerJoin Commissions On
    Jul'12AllAccnt(FUN).EmployeeID = Commissions.EmployeeID AND
    Jul'12AllAccnt(FUN).AccountID = Commissions.AccountID;

    Quote Originally Posted by orange View Post
    I think this should work but have not tested it.

    SELECT Table1.*
    , Table2.CommissionID
    FROM
    Table1 InnerJoin Table2 On
    Table1.AccountId = Table2.AccountId AND
    Table1.EmployeeId = Table2.EmployeeId;

  9. #9
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    So,

    I am very new in any programming language as well... I just wanted to confirm if I only need to type this (see below) in the sql view on query designer? Do I need to type anything else?? Please provide me with the full code... thanks

    SELECT Jul'12AllAccnt(FUN).*
    , Commissions.CommissionID
    FROM
    Jul'12AllAccnt(FUN) InnerJoin Commissions On
    Jul'12AllAccnt(FUN).EmployeeID = Commissions.EmployeeID AND
    Jul'12AllAccnt(FUN).AccountID = Commissions.AccountID;




  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,848
    Because you are using special characters in your table name - the special characters are '() -, you have to enclose any such field or table names in [] with Access. You should use a naming convention that uses alphanumerics and _ only, you will save yourself a lot of typing and a lot of headaches.

    You should try (again untested)
    SELECT [Jul'12AllAccnt(FUN)].*
    , Commissions.CommissionID
    FROM
    [Jul'12AllAccnt(FUN)] InnerJoin Commissions On
    [Jul'12AllAccnt(FUN)].EmployeeID = Commissions.EmployeeID AND
    [Jul'12AllAccnt(FUN)].AccountID = Commissions.AccountID;

  11. #11
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    it says "syntax error in from clause"

    Quote Originally Posted by orange View Post
    Because you are using special characters in your table name - the special characters are '() -, you have to enclose any such field or table names in [] with Access. You should use a naming convention that uses alphanumerics and _ only, you will save yourself a lot of typing and a lot of headaches.

    You should try (again untested)
    SELECT [Jul'12AllAccnt(FUN)].*
    , Commissions.CommissionID
    FROM
    [Jul'12AllAccnt(FUN)] InnerJoin Commissions On
    [Jul'12AllAccnt(FUN)].EmployeeID = Commissions.EmployeeID AND
    [Jul'12AllAccnt(FUN)].AccountID = Commissions.AccountID;

  12. #12
    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,848
    I just set up something similar

    SELECT [Animal(D'escription)].*
    , Animal.AName
    FROM
    Animal INNER JOIN [Animal(D'escription)]

    then realized it's the InnerJoin has to be 2 words INNER JOIN
    ON Animal.AnimalId = [Animal(D'escription)].id;

  13. #13
    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,848
    You should not cross post without advising the reader.
    http://www.access-programmers.co.uk/...70#post1185870

    Please don't cross-post without providing links to your cross-posts. We answer questions for free. Please don't waste the time of the people helping you.
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

  14. #14
    ewong is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    9
    Why is it asking for parameter value?

    Quote Originally Posted by orange View Post
    I just set up something similar

    SELECT [Animal(D'escription)].*
    , Animal.AName
    FROM
    Animal INNER JOIN [Animal(D'escription)]

    then realized it's the InnerJoin has to be 2 words INNER JOIN
    ON Animal.AnimalId = [Animal(D'escription)].id;

  15. #15
    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,848
    Check your field names, make sure the spelling is correct; verify against the table definition.

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

Similar Threads

  1. Help needed urgent
    By diljot5394 in forum Access
    Replies: 1
    Last Post: 04-23-2012, 02:44 AM
  2. Replies: 3
    Last Post: 12-18-2011, 04:17 AM
  3. please help urgent...thanks
    By dadas in forum Access
    Replies: 4
    Last Post: 10-13-2011, 01:42 PM
  4. Concatenation Urgent Help
    By Shoaib in forum Queries
    Replies: 0
    Last Post: 04-23-2009, 11:02 PM
  5. I need help! Urgent! :(
    By Suzan in forum Database Design
    Replies: 0
    Last Post: 04-08-2006, 11:58 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