jeremy0028
Technical User
I have the following in a subform in datasheet view
The form is called PeopleInsuranceSubform
ContactID(Auto# NonPK)
PersonID(lookup)
InsuranceName
Policy#
Group#
I also have a command button called Edit which has the following
Private Sub Edit_Click()
On Error GoTo Err_Edit_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPeopleInsurances"
stLinkCriteria = "[PersonID]=" & Me![PersonID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Edit_Click:
Exit Sub
Err_Edit_Click:
MsgBox Err.Description
Resume Exit_Edit_Click
End Sub
The Main form is called frmPeopleInsurances I'm trying to link the contactID and the Person Id in the subform so when user wants to edit all they have to do is click on the insurance in the subform and click the edit button to take them to the form called frmpeopleinsurance
I cant link the subform on click and the main form when edit is pressed.
Any Ideas
The form is called PeopleInsuranceSubform
ContactID(Auto# NonPK)
PersonID(lookup)
InsuranceName
Policy#
Group#
I also have a command button called Edit which has the following
Private Sub Edit_Click()
On Error GoTo Err_Edit_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPeopleInsurances"
stLinkCriteria = "[PersonID]=" & Me![PersonID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Edit_Click:
Exit Sub
Err_Edit_Click:
MsgBox Err.Description
Resume Exit_Edit_Click
End Sub
The Main form is called frmPeopleInsurances I'm trying to link the contactID and the Person Id in the subform so when user wants to edit all they have to do is click on the insurance in the subform and click the edit button to take them to the form called frmpeopleinsurance
I cant link the subform on click and the main form when edit is pressed.
Any Ideas