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!

How do I create PK's off another tables data? 1

Status
Not open for further replies.

ragepro

Technical User
Sep 9, 2003
8
US
I have two tables. My forms are set up so I have one form embedded into another each form using a table.

tables:
SYSTEM - contains general system data
DETAIL - contains individual discrepancies by date

forms:
SYSTEMF - contains SYSTEM table with DETAILF form embedded
DETAILF - contains DETAIL table

Obviously each SYSTEMF form allows me to input multiple details for that specific serial number. Or so it should. For some reason, the AUTOINCREMENT PK in the DETAIL table always remains the same unless I go to another SYSTEM record.

My thought is to create an autoincremented PK for the DETAIL table that corresponds with the current SYSTEM record's serial number. But how?

Hope this makes some kind of sense. Thanks in advance.

Adam
 
i should add that I'm using MS ACCESS in OFFICE XP

thanks again

Adam
 
What are the keys of SYSTEM and DETAIL?

A typical setup would be:
Table SYSTEM
SystemID: Autonumber - Primary Key
Table Detail
DetailID: Autonumber - Primary Key
SystemID: Long - foreign key to SYSTEM

With this setup, the Master Link Fields and Child Link Fields properties of the subform control would be set to SystemID.

I suspect that you're showing SystemID in the subform, but it's actually DetailID that you want.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I switched the link fields to DetailID and it now works like it should. Can't believe it was that simple!! Thanks!


-- яДGЄРЯΦ --

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top