Form join key question

sorebrain

Registered User.
Local time
Today, 11:04
Joined
Oct 8, 2004
Messages
27
On a simple 2 table DB I was trying originally to use the form wizard, select all the fields from the first table and only selected fields from the second table. Then I would select the view on the second page of the wizard to show all the fields from both tables, without separating them into a subform. Then when I would try to test the form I would get the error message:

Cannot add record(s); join key of 'tblTwo' not in recordset

I knew it was because the autonumber field I was using as a primary key in the second table was purposely left off of the form when I created it. And I knew it had to have the record created by incrementing the autonumber field. I just didn't know how to do it behind the scenes. Is this where code on an OnExit click event would solve the problem? The only way I won't be new at this is if I get old at it :D
 
SoreBrain,

Why not base your first form on your main table (or single-table query).

Then make a subform, use the Master-Child links, and let Access do all
of the synchronization?

Use the Search Facility here and look for "Master-Child" and you should
find some examples.

Wayne
 
I think I know that

About the Master-Child form. Isn't that the same as the Main form with a Subform on it? I already have that working. I was just curious as to why the wizard allows you to combine 2 tables, then set the view or layout to use the 2nd table (which puts all fields from both tables essentially on 1 form without a subform), and then refuses to work :confused:

added: Ok, now after trying it. New question: Can you do this when you combine 2 tables onto 1 form? I can't seem to locate the properties for linking when I do this. I am gueussing it only works with subforms and not combined tables on a single form. Is that correct?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom