I have a long list of clients with their Data as a subform. What I am trying to do it to get only the Client with their Data to be the only thing that prints. What I have created in my form is a "Print Preview" button that brings up the Report. The code is...
Private Sub cmdPrevRpt_Click()
On Error GoTo Err_cmdPrevRpt_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmClientDetail"
stLinkCriteria = "[strClnt#]=" & "'" & Me![strClnt#] & "'"
DoCmd.OpenReport stDocName, acPreview, , stLnkCriteria
Exit_cmdPrevRpt_Click:
Exit Sub
Err_cmdPrevRpt_Click:
MsgBox Err.Description
Resume Exit_cmdPrevRpt_Click
End Sub
However, when I run it I get the entire list and not the single client that I want. What do I need to do to modify the code to achive what I want to do.
Thank you for all your help and suggestions.
RobotMush (Technical User) Self Taught
Private Sub cmdPrevRpt_Click()
On Error GoTo Err_cmdPrevRpt_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmClientDetail"
stLinkCriteria = "[strClnt#]=" & "'" & Me![strClnt#] & "'"
DoCmd.OpenReport stDocName, acPreview, , stLnkCriteria
Exit_cmdPrevRpt_Click:
Exit Sub
Err_cmdPrevRpt_Click:
MsgBox Err.Description
Resume Exit_cmdPrevRpt_Click
End Sub
However, when I run it I get the entire list and not the single client that I want. What do I need to do to modify the code to achive what I want to do.
Thank you for all your help and suggestions.
RobotMush (Technical User) Self Taught