AutoNumber not matching between Table and Form

cbearden

Registered User.
Local time
Yesterday, 20:29
Joined
May 12, 2004
Messages
84
I have a form, its based on a query. That query contains an Autonumber(intID) from a Table(customers). I also have another table(dealers), that uses the ID number as well. Next to the dealer info, I can click the "+" and it'll show all customers pertaining to that dealer.

I've seen some that have had different ID numbers. In the form, one has the ID of 222...while in the Dealer Table it has the ID of 227.

Does anyone know what the problem is?

Also...I have a subform where you can add a dealer to this Dealer Table if it does not exist in the combo box. Here's the code:

If MsgBox("Add New Dealer Number?", vbYesNo, "Warning") = vbYes Then
DoCmd.OpenForm "DealerContact", acNormal, , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
End If


Thanks for the help.
 
Have you set up relationships between your tables?
I assume you're using an AutoNumber column DealerID as Primary Key on your tblDealer, an AutoNumber column CustomerID as Primary Key on your tblCustomer and did include the CustomerID as Foreign Key in tblDealer (assuming a customer will at most have one dealer, otherwise you need a junction table).

I've seen some that have had different ID numbers. In the form, one has the ID of 222...while in the Dealer Table it has the ID of 227

Are you sure that both ID values reflect the same column in the same table???

RV
 
RV said:
Are you sure that both ID values reflect the same column in the same table???

Yes.

Also...

I have 3 tables: Customers, Dealers, Autos

Dealer - Customer = intDealerNum (PK for Dealer Table)
Customer - Autos = intID (PK for Customer Table)

Thanks for the reply!
 

Users who are viewing this thread

Back
Top Bottom