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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

relating two fields to the primary key

Status
Not open for further replies.

atadbitslow

Programmer
Feb 26, 2001
301
US
I have table A with a primary key autonumber field. In table B, there needs to be two fields (field 1 and field 2)related to the primary key in table A. Is this possible?

Thanks! Excuse my confusion....it's only temporary......
 
Yes, just set the data type of the fields in Table B to Long Integer. It should work easily.
 
Why do you say you need two fields related to the other table's PK? They will be identical. What are you doing with the fields?

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Actually Jeremy, they wouldn't necessarily be identical. For instance, imagine an Employee table with 2 department fields (to allow Employees to work in more than one department). Each of the two department fields would be related to the primary key of the Department table.
 
KornGeek,

That would be very poor database design. The proper thing to do there would be to have a lookup table to facilitate a many-to-many relationship. Otherwise it's gonna be a real drag when some hotshot starts working in a third department.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Jeremy,
I'll agree that it might not be the best design, but there are some other circumstances where it might be appropriate. (None come to mind, but I'm sure there are some.)

 
I'm biting my keyboard even as we type!!!

Jeff Bridgham
bridgham@purdue.edu
 
Move along folks, there's nothing to see here... =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Hi AT,

What are the 2 fields called?
And why do you need these 2 fields? How are you meaning to use 'em?

We can go from there.

Regards,

Darrylle
"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top