Trying to update two tables based on "primary" table

  • Thread starter Thread starter unemployed
  • Start date Start date
U

unemployed

I have three tables

One for just Names (tblNames)
One for Just contact Info (tblContactInfo)
One for division (tblDivision)

tblNames is the main table for everything and the index is an ID of type
autonumber.

I have a query in which I am trying to add a new person, while updating
tblContactInfo and tblDivision at the same time. The idea is simply to have
the autonumbered ID of tblNames updated simultaneously with the other two
tables so the ID "stays" with the individual. The indexed ID's of the other
two tables are both of type "number."

The query is running a simple form to input all of the information at once.
When I run the form, I get problems after the first record is entered.

"The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or
relationship...."

The "ID" is updated from the primary table to one of the other tables, but
not the third? I know this has to be simple. It's been a while. Any help
would be appreciated.
 
Hi,



I just had this saem problem. What you need to do is make sure that the
ID in the second table matchs the first.



This can be done by in the querie, putting in the Critirea row,



Or in the form in the before update box, of the properties, of
the ID Box.



a statment that will read somthing like this



=[Table1]![Table_ID]







This will then make the two tables have the same ID.



So the second should not have an auto number but should have the ID
forced in by the first.



I hope this helped.



Sorry about the spelling, am in a hurry.



Davey



London
 
Back
Top