R
rfrench
I am in a form which has a subform, which is viewed as a datasheet of a query
(showing all of my clients). I want to click on 1 record on the subform data
sheet and then click a command button (on the form), which will take me to
that record's client form. This is what I have for the Event Procedure for
the command button:
Private Sub Test_Click()
On Error GoTo Err_Test_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Transaction Detail"
stLinkCriteria = "[Exchange No]=" & "'" & Me![Exchange No] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Test_Click:
Exit Sub
Err_Test_Click:
MsgBox Err.Description
Resume Exit_Test_Click
End Sub
This takes me to the correct form ("Transaction Detail"), but not for the
chosen record. What am I doing wrong?
Thanks.
(showing all of my clients). I want to click on 1 record on the subform data
sheet and then click a command button (on the form), which will take me to
that record's client form. This is what I have for the Event Procedure for
the command button:
Private Sub Test_Click()
On Error GoTo Err_Test_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Transaction Detail"
stLinkCriteria = "[Exchange No]=" & "'" & Me![Exchange No] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Test_Click:
Exit Sub
Err_Test_Click:
MsgBox Err.Description
Resume Exit_Test_Click
End Sub
This takes me to the correct form ("Transaction Detail"), but not for the
chosen record. What am I doing wrong?
Thanks.