Please help!!
I have a main form and a subform with a relationship link. I used a button with the openform command and built the following code:
Private Sub HPIComplaint1_Click()
On Error GoTo Err_HPIComplaint1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "HistoryofPresentIllness"
stLinkCriteria = "[Key]=" & Me![Key]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_HPIComplaint1_Click:
Exit Sub
Err_HPIComplaint1_Click:
MsgBox Err.Description
Resume Exit_HPIComplaint1_Click
End Sub
This correctly opens the form, but it opens as a parallel form NOT a child linked form. I need this to be a child linked form OR have the PK and FK "KEY" fields to autopopulate and link.
Where did I go wrong??
Please and thank you!! Kristyn
I have a main form and a subform with a relationship link. I used a button with the openform command and built the following code:
Private Sub HPIComplaint1_Click()
On Error GoTo Err_HPIComplaint1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "HistoryofPresentIllness"
stLinkCriteria = "[Key]=" & Me![Key]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_HPIComplaint1_Click:
Exit Sub
Err_HPIComplaint1_Click:
MsgBox Err.Description
Resume Exit_HPIComplaint1_Click
End Sub
This correctly opens the form, but it opens as a parallel form NOT a child linked form. I need this to be a child linked form OR have the PK and FK "KEY" fields to autopopulate and link.
Where did I go wrong??
Please and thank you!! Kristyn