G
Guest
I have a main form with a command button on it. The command button has this
code, which opens a form and displays only those records in a related table
that have a matching ID to the main form.
Private Sub Command116_Click()
On Error GoTo Err_Command116_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmReportDocLinks"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command116_Click:
Exit Sub
Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click
End Sub
What I want instead is for the command button (on the main form) to open a
form that has a subform, and for that subform to display only those records
in the related table that have a matching ID to the MAIN form.
Any suggestions?
code, which opens a form and displays only those records in a related table
that have a matching ID to the main form.
Private Sub Command116_Click()
On Error GoTo Err_Command116_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmReportDocLinks"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command116_Click:
Exit Sub
Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click
End Sub
What I want instead is for the command button (on the main form) to open a
form that has a subform, and for that subform to display only those records
in the related table that have a matching ID to the MAIN form.
Any suggestions?