Primary Key from main table to be ID in other tables

smithjp4

New member
Local time
Today, 14:43
Joined
Nov 22, 2011
Messages
4
I am building a database in Acess 2007 and I have three tables housing data...one table houses the main data, one houses fiscal data and the third houses accounting line data. tblMain has a primary key set to auto number, tblFiscal and tblAccountingLine both have their ID field set to number (no primary key, as they need to allow duplicate values).

What I want is to have the primary key from tblMain be automatically inserted into the ID field of tblFiscal and tblAccountingLine...

The reason I need this is to auto-populate these fields in the forms for entering the data...right now I have to enter it manually to keep all of the data linked properly.

Thank you
 
Thank you so much for your quick reply...however...this doesn't exactly help...

Perhaps I didn't explain properly.

In the forms, themselves, if record 9 in frmMain is active, and record 9 also has had information entered in frmFiscal and frmAccountingLine, then clicking the buttons to display the frmFiscal and frmAccountingLine does bring up the correct information for record 9.

What I want relates to new record entries. So, if I'm making a new entry in frmMain for record 10, and then click the buttons to add new data into frmFiscal and frmAccountingLine, I want the record number from frmMain (i.e. primary key in tblMain) to auto-populate the ID fields in frmFiscal and frmAccountingLine, thereby updating ID field tblFiscal and tblAccountingLine.
 

Users who are viewing this thread

Back
Top Bottom