Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Linking Edit command button and form

Status
Not open for further replies.

jeremy0028

Technical User
Oct 9, 2005
37
0
0
US
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


 
Is this possibly your problem:
in the subform and click the edit button to take them to the form called frmpeopleinsurance
Note the lack of an [!]s[/!], but in your code you have:
Code:
stDocName = "frmPeopleInsurance[!]s[/!]"

Maybe a typo?

Tom

Live once die twice; live twice die once.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top