Db-why-not
Registered User.
- Local time
- Today, 17:08
- Joined
- Sep 17, 2019
- Messages
- 159
I created a Data Macro with my backend table. I used the After Insert event for my New_Patients table, it triggers a new record to be created in my Patient_Status table. The two tables are linked. The Data Macro works great when I add new records directly in the New_Patients table, It will create a new record in the Patient_Status table but when I use my forms to create a new record it gives me an error message. "The changes 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."
My Main form has text boxes to create records for the New_Patients table Research_ID (Primary Key) and Chron textbox. All the subforms on the mainform are linked to the Research_ID field that is on the mainform and is in the New_Patients table. Then there is a subform with textboxes for the Patient_Status table, I have that subform linked by the Research_ID field.
What might be causing this error. The data Macro works great when I'm not using the forms.
I have attached screen shots of the data macro and the error message, screenshot of my forms.
My subform for table Patient_Status includes data fields Status, Still_Admitted, Data_last_updated, Research_ID (Foreign Key)
Thanks for any help!
My Main form has text boxes to create records for the New_Patients table Research_ID (Primary Key) and Chron textbox. All the subforms on the mainform are linked to the Research_ID field that is on the mainform and is in the New_Patients table. Then there is a subform with textboxes for the Patient_Status table, I have that subform linked by the Research_ID field.
What might be causing this error. The data Macro works great when I'm not using the forms.
I have attached screen shots of the data macro and the error message, screenshot of my forms.
My subform for table Patient_Status includes data fields Status, Still_Admitted, Data_last_updated, Research_ID (Foreign Key)
Thanks for any help!