Form Error: Cannot Add Records; Join Key...

thatlem

Registered User.
Local time
Today, 13:33
Joined
Jan 29, 2009
Messages
115
I have a new build with a data entry form bound to a query which pulls from my "main" table and one linked table. The query pulls all the fields from the main table plus all the fields from the linked table. The primary keys for both tables are located in the query. The query runs fine.

I have one record in the tables which displays in the form. However, when I click to add a new record, I get the following error: "Cannot add record(s); Join Key of table "Main Table" not in recordset."

I've never run into this problem before...
Running Access 2007 in XP environment.

Thanks for the assist. :confused:
 
Normally, to add a record you should just have One Table only on the form.

This is why most often you have a SubForm to Add the record into the one table the subform uses.
 
Since when is it required to link a form to a table? Forms can be linked to queries which are linked back to tables.

I have built many applications this way without a problem. That's why this is so confusing, I'm doing nothing different from what I have done in the past, yet this is the first time I have seen this error.
 
Since when is it required to link a form to a table? Forms can be linked to queries which are linked back to tables.

I have built many applications this way without a problem. That's why this is so confusing, I'm doing nothing different from what I have done in the past, yet this is the first time I have seen this error.

Yes, a form can (and should) be linked to a query. But it all depends on what tables and fields are in that query as to whether it will be able to be used on a form in an updateable mode.

Can you post a copy of your database with some bogus data?
 
Thanks, however, I just decided to make life easier and put the 12 items in my main table. So now it's fine.

Thanks for your consideration...
 
I meant to have One Table on a Form where you are editing, adding or deleting records. This can be via a query but when you join tables in a query, you most often are no longer able to "edit" data in that query.

Have your Form as you like with as complicated a query as you wish and the "Edit" part is done on a SubForm to your mainform.
The SubForm datasource can be a query but this query only uses the one table with the fields to be "edited"
When you Format the subform it will appear to uses as one big form.
 

Users who are viewing this thread

Back
Top Bottom