Link to home
Start Free TrialLog in
Avatar of João serras-pereira
João serras-pereiraFlag for Portugal

asked on

error 80020009 - cannot add record(s); join key of table '...' not in record set

Hi-

When I am trying to add a record to a Tabla, using a query, I am getting the error. I am using the query to simultaneously add a record on each of the 3 foundation tables. For the first 2 tables it is ok, but not to the 3rd.

Can anyone help?


User generated image


User generated image

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of João serras-pereira

ASKER

Hi Gustav -

That puts me scratching my head.

The joined field is [codigoTabanca] on all three tables and I am trying to create a new record for all of them within the same query. It works for tables [tabancasbase] and [tabancasDetalhe] (the latter is a simple extension of the former.  

But, for [tabancasMarksGPSD] I will have many records and the actual key is not [codigoTabanca] but [codigoPonto] as there will exist several diferent [codigoPonto] for a single [codigoTabanca] - wthin this form I need to generate the very first record of it.

What would you recommend? drop [tabancasMarksGPSD] from the query and manual insert it using vba?

kindest regards


joao
Well, the fields you join must have identical values.

It sounds like you must rethink what you are doing.

/gustav
thanks for pointing in the right direction. I  replaced the source of [codigoTabanca] at it works!
You are welcome!

/gustav