Navyguy
Registered User.
- Local time
- Today, 02:28
- Joined
- Jan 21, 2004
- Messages
- 194
Hi All
I have tried my first attempt at making some tabbed subforms and I have come up with an error that I cannot seem to put my finger on.
The error states “The changes that you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index or redefine the index to permit duplicate entries and try again.”
What I have is basically 2 versions of the same Mainform and subforms, one for Editing Data and one for Data Entry. Both are set up exactly except for the Data entry property set as required. The problem is on the data entry Mainform and subforms.
I have one tabbed form’s source the same as the mainform and the other 3 subforms source as different tables. The Mainform has some of the tombstone information, IDNumber, Surname, FirstName, etc. The first tabbed form has an continuation of the information, Address, HomePhone etc. The other tabbed forms have info like NextOfKin information and EmploymentQualifications, etc.
If I enter the data on the Mainform and select any of the other tabs (except for the first subform) it allows me to enter the data and saves the record. If I enter the first tabbed form (the one with the same source as the Mainform) as soon as I try to exit that subform the error above comes up.
I am sure that I have the correct linked master and child fields, my relationships seem to be OK when working with the same forms in the edit mode and my PK are set to no duplicates.
Main form table has a PK PersonID Autonumber
PK IDNumber (this is the field that is used for linking all the other tables) (set to no duplicates)
My guess is that the problem is when I move from the Mainform to the subform with the same source it saves the IDNumber, then when I move from the first subform to the next it tries to save the IDNumber again, but I am not sure.
Can somebody point me in the right direction?
As always, thanks for your help
I have tried my first attempt at making some tabbed subforms and I have come up with an error that I cannot seem to put my finger on.
The error states “The changes that you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index or redefine the index to permit duplicate entries and try again.”
What I have is basically 2 versions of the same Mainform and subforms, one for Editing Data and one for Data Entry. Both are set up exactly except for the Data entry property set as required. The problem is on the data entry Mainform and subforms.
I have one tabbed form’s source the same as the mainform and the other 3 subforms source as different tables. The Mainform has some of the tombstone information, IDNumber, Surname, FirstName, etc. The first tabbed form has an continuation of the information, Address, HomePhone etc. The other tabbed forms have info like NextOfKin information and EmploymentQualifications, etc.
If I enter the data on the Mainform and select any of the other tabs (except for the first subform) it allows me to enter the data and saves the record. If I enter the first tabbed form (the one with the same source as the Mainform) as soon as I try to exit that subform the error above comes up.
I am sure that I have the correct linked master and child fields, my relationships seem to be OK when working with the same forms in the edit mode and my PK are set to no duplicates.
Main form table has a PK PersonID Autonumber
PK IDNumber (this is the field that is used for linking all the other tables) (set to no duplicates)
My guess is that the problem is when I move from the Mainform to the subform with the same source it saves the IDNumber, then when I move from the first subform to the next it tries to save the IDNumber again, but I am not sure.
Can somebody point me in the right direction?
As always, thanks for your help