Adding to Multiple Tables

MadCat

Registered User.
Local time
Today, 18:07
Joined
Jun 24, 2003
Messages
62
I have a problem which i hope someone will know the answer to, its probably really simple.

I have a form bound to a table which stores personal details of people, there is a primary key field called "log book number". What i'd like to do is click a button on my form which takes me to a test details screen. Before i go to this screen i will save the record but more importantly i need to have the log book number stored in another table as well called "test details".
Is there an easy way to do this? The "test details" table has other entries in it that are to be filled out on the test details form.

i had thought an append query but i cannot seem to get that to work.

Hope this makes sense.

Thanks in advance
 
MadCat

From your initial description it sounds as though you have two tables:

Personal, which has LogBookNo as your Primary Key

-and-

TestDetails

You appear to say that One Personal can have Many TestDetails associated with it, therefore you should include LogBookNo as the Foreign Key in the TestDetails table.

You should then build a main form and a subform to allow you to update both of the tables at once.

If this is not what you are after please post back and let us know.

Graham
 
One person can have one set of test details. The problems occur when trying to add a new person. once added and the test details button is clicked the test details form comes up blank. This is because the test details table has not had the relevant logbook number entry created in it. If i was to go in to the "test details" table and manually enter the logbook number then the "test details" form would open with details in it instead of being blank. I need a way to add the logbook number to the test details table once the new user has been added to the "personal details" table.

Does this make any more sense to you?

Thanks for your help
 
If the infomation has a One-to-One relationship you could, in fact, store all of this information in the one table. However there maybe reasons that you wish to store this information in only one table.

You could use the Open Arguments property of the form to pass the Logbook Number to the second form.

Look for help on Open Arguments in the Access Help files.

Graham
 

Users who are viewing this thread

Back
Top Bottom