Navyguy
Registered User.
- Local time
- Today, 03:03
- Joined
- Jan 21, 2004
- Messages
- 194
Hello All
Just getting back into Access after about 7 or so years away... seems I have forgot everything!!!
Back to a basic question(s)...
I have a Details_Form form based on a query of a single field (Equipment_ID_Number) which is an Indexed (No Duplicates) value (but not the primary key). The query comes from Tbl_Equipment.
The Details_Form Form_Load() SetFocus is on the Equipment_ID_Number that is established previously. This is to confirm that the user is editing the correct record; there can only be one Equipment_ID_Number.
The Equipment_Information form is a subform inside the Details_Form. The subform is based on a Tbl_Equipment and is supposed to be used to update the remaining fields after the Equipment_ID_Number is entered and saved to the table.
The Equipment_ID_Number is the linked field between the Details_Form and the Equipment_Information subform. The TextBox for the Equipment_ID_Number is hidden on the subform (not that matters). I have unhidden it to confirm that the Equipment_ID_Numbers match for troubleshooting purposes.
I can enter the data in the remaining boxes on the subform (which are the remainder of the fields in Tbl_Equipment); when I go to move to the next record I get an error that I am creating a duplicate entry in an indexed field (Equipment_ID_Number).
So what I think is happening is that when I move to the next record the subform (or maybe the mainform) tries to save the information in the linked master/child fields even though it was created by the .setfocus on the Details_Form.
I do not have any problems with my other subforms as they allow duplicates with the Equipment_ID_Number.
I am sure it is something really simple I am missing, but have spent hours searching for something simple and have found nothing. Perhaps the easy solution would be to allow the entry of the all that information on the same page instead of using subforms, but I am sure I have done this before in older versions of access with success.
Cheers
John
Just getting back into Access after about 7 or so years away... seems I have forgot everything!!!
Back to a basic question(s)...
I have a Details_Form form based on a query of a single field (Equipment_ID_Number) which is an Indexed (No Duplicates) value (but not the primary key). The query comes from Tbl_Equipment.
The Details_Form Form_Load() SetFocus is on the Equipment_ID_Number that is established previously. This is to confirm that the user is editing the correct record; there can only be one Equipment_ID_Number.
The Equipment_Information form is a subform inside the Details_Form. The subform is based on a Tbl_Equipment and is supposed to be used to update the remaining fields after the Equipment_ID_Number is entered and saved to the table.
The Equipment_ID_Number is the linked field between the Details_Form and the Equipment_Information subform. The TextBox for the Equipment_ID_Number is hidden on the subform (not that matters). I have unhidden it to confirm that the Equipment_ID_Numbers match for troubleshooting purposes.
I can enter the data in the remaining boxes on the subform (which are the remainder of the fields in Tbl_Equipment); when I go to move to the next record I get an error that I am creating a duplicate entry in an indexed field (Equipment_ID_Number).
So what I think is happening is that when I move to the next record the subform (or maybe the mainform) tries to save the information in the linked master/child fields even though it was created by the .setfocus on the Details_Form.
I do not have any problems with my other subforms as they allow duplicates with the Equipment_ID_Number.
I am sure it is something really simple I am missing, but have spent hours searching for something simple and have found nothing. Perhaps the easy solution would be to allow the entry of the all that information on the same page instead of using subforms, but I am sure I have done this before in older versions of access with success.
Cheers
John
Last edited: