Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with primary keys, duplicate names, combo boxes....etc!!

Status
Not open for further replies.

ljjtek

Technical User
Feb 26, 2001
35
US
OK, I have a problem and think that I could go about solving it a couple ways... Here is the problem:

I have a "Client" table with the Client name being the primary key. I have the Client name in another table and they are linked and everything. The problem is that the "Client" is the name of the company and not the actual name of the person, and there is more than one person that belongs with each company. I know that I want the company to be the primary key, but how can I do that? I thought I could even use multi combo boxes on a form and have the first box bring up the names of the people from that specific company in another combo box, if there is more than one listing for that company.

Sounds a bit confusing....sorry.... but anyone have any ideas? I am new at this; so sorry if the answer is an obvious one....

Thanks, Lauren
 
You do NOT want the company name to be the primary key. You've fallen into a trap that many have fallen into. You think the primary key has to "mean" something. It doesn't. Change the PK to an autonumber field and change the table to Customer. Create another table(again it's PK should be autonumber) for clients. Add a FOREIGN KEY field to the client table linking it to the PRIMARY KEY of the customer table. This will give you a ONE-TO-MANY relationship between customer and the clients that are associated with that customer.
 
Hi Lauren,

I feel your pain. Understanding relationships between tables is one of the most difficult things for new users to understand, believe me, I've been there. Jerry's advice is good but as a newbie you may have difficulty understanding foreign keys, etc.

The best advice I could give is make a lot of use of Access help. I think it is great. Also get a book like Dummies. You really need to understand relationships before you can go anywhere with this program.

Lastly, if you want me to send you a couple example files that accomplish what you want send me and e-mail. My address is in my profile.

Best regards,

Henr¥
 
Woody's Access Watch this week has exactly what you want to describe how a relational database works. (Lovely and simple to understand). If you were to sign up for it (it's a free emailed service) now you would probably get it. If not I could email it through to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top