M
Mishanya
I have a form (based on query) wich presents ClientName from tblClientDetails.
I want to program a DblClick event, so the user can doubl-click the
ClientName and open frmClientDetails.
So far I have this:
Private Sub ClientName_DblClick(Cancel As Integer)
On Error GoTo Err_ClientName_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmClientDetails"
stLinkCriteria = "[ClientName]=" & "'" & Me![ClientName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ClientName_Click:
Exit Sub
Err_ClientName_Click:
MsgBox Err.Description
Resume Exit_ClientName_Click
End Sub
This routine opens the frmClientDetails filtered for all the clients with
matching name.
What should I add to make this procedure open the frmClientDetails for
specific ClientID? I don't want to have CientID txtBox in my form (at least -
not visible), so adding such a txtbox and setting the Click event on it is
not an option. So, probably, I have to trick somehow the criteria line:
stLinkCriteria = "[ClientName]=" & "'" & Me![ClientName] & "'"
so it will check the ClientID field from the query wich the form is based on?
I want to program a DblClick event, so the user can doubl-click the
ClientName and open frmClientDetails.
So far I have this:
Private Sub ClientName_DblClick(Cancel As Integer)
On Error GoTo Err_ClientName_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmClientDetails"
stLinkCriteria = "[ClientName]=" & "'" & Me![ClientName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ClientName_Click:
Exit Sub
Err_ClientName_Click:
MsgBox Err.Description
Resume Exit_ClientName_Click
End Sub
This routine opens the frmClientDetails filtered for all the clients with
matching name.
What should I add to make this procedure open the frmClientDetails for
specific ClientID? I don't want to have CientID txtBox in my form (at least -
not visible), so adding such a txtbox and setting the Click event on it is
not an option. So, probably, I have to trick somehow the criteria line:
stLinkCriteria = "[ClientName]=" & "'" & Me![ClientName] & "'"
so it will check the ClientID field from the query wich the form is based on?