Form with two or more tables connected

pjStyle

Registered User.
Local time
Today, 11:57
Joined
Nov 24, 2003
Messages
13
I have a question for school. We are doing a project for a company, whe're rebuilding they're current database.
What my problem is at the moment, is that i have one form which i have a query attached to as datasouce. The selecting of the records works just fine, but now i want to add new records to the two tables. Which is not working because of the select query attached to the form.
What is another good option when you have one form which must be able to mutate values in two ( or more ) tables?

Thanks in advance,

Ted de Vries
 
pjStyle said:
What is another good option when you have one form which must be able to mutate values in two ( or more ) tables?

If it is the same information you are trying to put into multiple tables then stop now as there's no need to duplicate information in another table.

If you want to put different information into different tables from one form then, provided your relationships are correct, you can use a subform and link fields between the two RecordSources of the subform and the parent form.
 
You can also use ADO or DAO to add, edit, or delete data from multiple tables.
 
Assuming you have these two tables:
tblA
tblAID (primary key)
etc.

tblB
tblBID (primary key)
tblAID (foreign key to tblA)
etc.

The two tables are joined on tblAID.

1. If you want to be able to add rows to tblA, you must include tblA.tblAID in the query.
2. If you want to be able to add rows to tblB, you must include tblB.tblAID in the query.
 

Users who are viewing this thread

Back
Top Bottom