I'm want to open a report that only shows records based on values I pass from a form. I don't get any errors but my code isn't finding any records when I pass values to the report. I know the record is there.
Private Sub cmdPrintMILSTRIP_Click()
On Error GoTo Err_cmdPrintMILSTRIP_Click
Dim stDocName As String
stDocName = "rptPrintMILSTRIP"
DoCmd.OpenReport stDocName, acPreview, , _
"Reports!rptPrintMILSTRIP.JD = Forms!frmReqnWatch.JD " _
& "And Reports!rptPrintMILSTRIP.Serial = Forms!frmReqnWatch.Serial"
Exit_cmdPrintMILSTRIP_Click:
Exit Sub
Err_cmdPrintMILSTRIP_Click:
If Err.Number = 2001 Or Err.Number = 2501 Then
Else
MsgBox "Error #" & Err.Number & Chr(10) & Chr(13) _
& Err.Description, vbOKOnly, "RPP Tracking System"
End If
Resume Exit_cmdPrintMILSTRIP_Click
End Sub
Private Sub cmdPrintMILSTRIP_Click()
On Error GoTo Err_cmdPrintMILSTRIP_Click
Dim stDocName As String
stDocName = "rptPrintMILSTRIP"
DoCmd.OpenReport stDocName, acPreview, , _
"Reports!rptPrintMILSTRIP.JD = Forms!frmReqnWatch.JD " _
& "And Reports!rptPrintMILSTRIP.Serial = Forms!frmReqnWatch.Serial"
Exit_cmdPrintMILSTRIP_Click:
Exit Sub
Err_cmdPrintMILSTRIP_Click:
If Err.Number = 2001 Or Err.Number = 2501 Then
Else
MsgBox "Error #" & Err.Number & Chr(10) & Chr(13) _
& Err.Description, vbOKOnly, "RPP Tracking System"
End If
Resume Exit_cmdPrintMILSTRIP_Click
End Sub