Grid subform can only add one record at a time
Posted: Sun Dec 15, 2024 10:01 pm
Hi
I have a Browse/Edit form called Household and a subform called Household Members. Primary key of Household is household_id which is joined to subform field household_id. The primary key of household members form is member_id.
I can open a household from the browse screen and it will show household members in a grid in the subform. So far, so good.
BUT
if I want to add more than one household member to the subform, it will only save the first record. Subsequent records are trying to use the same value for the member_id so the record isn't saved and the debug gives the message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '675f3f78' for key 'PRIMARY' Why don't the new rows create new records?
Any help gratefully received!
I have a Browse/Edit form called Household and a subform called Household Members. Primary key of Household is household_id which is joined to subform field household_id. The primary key of household members form is member_id.
I can open a household from the browse screen and it will show household members in a grid in the subform. So far, so good.
BUT
if I want to add more than one household member to the subform, it will only save the first record. Subsequent records are trying to use the same value for the member_id so the record isn't saved and the debug gives the message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '675f3f78' for key 'PRIMARY' Why don't the new rows create new records?
Any help gratefully received!