I would like to preview a report when a user clicks a button in a form. But i only want it to display records where [Duck] matches what has been entered on the form. For example if [Duck] contained the text 'black' the report would only show black ducks.
Could someone give me idiot proof instructions on how to do this?
Private Sub Command149_Click()
On Error GoTo Err_Command149_Click
Dim stDocName As String
stDocName = "rptYour_Duck"
DoCmd.OpenReport stDocName, acPreview
Exit_Command149_Click:
Exit Sub
Err_Command149_Click:
MsgBox Err.Description
Resume Exit_Command149_Click
End Sub
Ta very much
Jane
Could someone give me idiot proof instructions on how to do this?
Private Sub Command149_Click()
On Error GoTo Err_Command149_Click
Dim stDocName As String
stDocName = "rptYour_Duck"
DoCmd.OpenReport stDocName, acPreview
Exit_Command149_Click:
Exit Sub
Err_Command149_Click:
MsgBox Err.Description
Resume Exit_Command149_Click
End Sub
Ta very much
Jane