If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Attention Allen Browne
Hi Allen -
You were helping me with my problem and I had another question for you. I'm confused as to how my [Users and Interests] table should look. Would you be able to tell me which fields I need in my table, which should be the primary key and which fields should be linked to my other tables to establish the relationship between them and the [Users and Interests] table. Sorry to be so confused, but I'm really new at this. I really appreciate all of your help. Thanks! In the Relationships window (Tools | Relationships), drag: - UserId from the User table onto UserId in the [Users and Interests] table. - InterestId from the Interests table onto InterestId in the [Users and Interests] table BTW, just noticed you had a UserInterestId field in the [Users and Interests] table? That should be an InterestId field (foreign key, not primary key.) The primary key of [Users and Interests] table will be the combination of UserId + InterestId (i.e. select both fields in table design view, and press the Key icon on the toolbar.) Using the combination of the 2 fields as primary key means that you cannot enter the same UserId and InterestId combination multiple times in [Users and Interests] table. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Ann" Ann @discussions.microsoft.com wrote in message ... Allen, thanks for the help. One more question: how do I link the tables together? Do I link them by their primary keys? Thanks again. "Ann" wrote: Hello - I am a new user trying to design a database. I need some direction on how to link my tables together. What I am trying to accomplish is the following: I need to link a user with their interests. I need to create a form that shows the user information (name, address, etc...) and a subform that has a drop-down menu with a list of interests for the user to choose. They should be able to choose more than one interest and have those interest choices be stored in the User and Interests table. My first problem is that I'm not sure how to link the tables together to make this happen. My second problem is that I'm not sure how to allow for multiple interest choices in the subform. I will eventually need to create a query that shows which user has which interests. For example, user#1's interests are swimming, bowling and skiing. Below are my tables/fields. Can anyone provide any guidance? Please be as specific as possible as I'm new to this! Thanks! My first table (Users) has the following fields: UserID (primary key) UserFirstName UserLastName User Address My second table (Interests) has the following fields: InterestID (primary key) InterestName My third table (Users and Interests) has the following fields: UserInterestID UserID |
#2
|
|||
|
|||
Ann, I just posted a followup to the previous thread.
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Ann" wrote in message ... Hi Allen - You were helping me with my problem and I had another question for you. I'm confused as to how my [Users and Interests] table should look. Would you be able to tell me which fields I need in my table, which should be the primary key and which fields should be linked to my other tables to establish the relationship between them and the [Users and Interests] table. Sorry to be so confused, but I'm really new at this. I really appreciate all of your help. Thanks! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Allen Browne Audit Log | David | General Discussion | 2 | April 18th, 2005 10:51 PM |
Allen Browne Rocks! | Bill Mitchell | Using Forms | 2 | August 10th, 2004 05:50 AM |
Allen Browne | Kasey | Using Forms | 4 | August 5th, 2004 12:52 PM |
AddressLayout Bold Attention Line | Shauna Koppang | Mailmerge | 1 | June 9th, 2004 04:09 PM |
To: Allen Browne changing date format in query | Running & Setting Up Queries | 1 | May 25th, 2004 06:00 PM |