Linking Forms and Subforms

L

LeslieJ

I have a database that inventories controlled documents. Each document has a
version, or possibly many versions.

I would like to set up a form and subform so that the document number is in
the main form, and the subform contains the version specific information.
Each document number has it's own identifier.

I cannot figure out how to link the two forms so that the multiple versions
stay attached to the document number.
 
B

Beetle

So you have one unique Document number, with one or many Versions
related to that Document?

If so, you need one table (ie tblDocuments) to store the Document No. plus
any general info about the document that is unaffected by the Version No.
If the Document number will always be unique and never repeated, then you
can use that as the Primary Key (ie DocumentID), otherwise you could use
an autonumber PK.

You need another table to store information about each Version
(ie tblVersions) with it's own unique PK, plus a DocumentID field
as a Foreign Key to tblDocuments.

Then you main form would be based on tblDocuments and your subform
based on tblVersions, linked by DocumentID
 
L

LeslieJ via AccessMonster.com

Thank you so much! I thought that was going to be it, but thank you so much
for confirming that it was!

Have a great day :eek:)
So you have one unique Document number, with one or many Versions
related to that Document?

If so, you need one table (ie tblDocuments) to store the Document No. plus
any general info about the document that is unaffected by the Version No.
If the Document number will always be unique and never repeated, then you
can use that as the Primary Key (ie DocumentID), otherwise you could use
an autonumber PK.

You need another table to store information about each Version
(ie tblVersions) with it's own unique PK, plus a DocumentID field
as a Foreign Key to tblDocuments.

Then you main form would be based on tblDocuments and your subform
based on tblVersions, linked by DocumentID
I have a database that inventories controlled documents. Each document has a
version, or possibly many versions.
[quoted text clipped - 5 lines]
I cannot figure out how to link the two forms so that the multiple versions
stay attached to the document number.
 
Top