G
Guest
can anyone help? why am i getting this message when i use this code:
Private Sub PrintAudit_Click()
On Error GoTo Err_PrintAudit_Click
Dim stDocName As String
Dim Response As Integer
stDocName = "Audit Report"
If Me.Earliest.Value Is Not Null And Me.Latest.Value Is Not Null Then
DoCmd.OpenReport stDocName, acNormal, , "[Date of Audit] Between
Forms![Print Report].Earliest and Forms![Print Report].Latest"
Else
Response = MsgBox("You must enter the range of dates the Audit Report
spans", vbCritical + vbOKOnly)
End If
Exit_PrintAudit_Click:
Exit Sub
Err_PrintAudit_Click:
MsgBox Err.description
Resume Exit_PrintAudit_Click
End Sub
-ted
Private Sub PrintAudit_Click()
On Error GoTo Err_PrintAudit_Click
Dim stDocName As String
Dim Response As Integer
stDocName = "Audit Report"
If Me.Earliest.Value Is Not Null And Me.Latest.Value Is Not Null Then
DoCmd.OpenReport stDocName, acNormal, , "[Date of Audit] Between
Forms![Print Report].Earliest and Forms![Print Report].Latest"
Else
Response = MsgBox("You must enter the range of dates the Audit Report
spans", vbCritical + vbOKOnly)
End If
Exit_PrintAudit_Click:
Exit Sub
Err_PrintAudit_Click:
MsgBox Err.description
Resume Exit_PrintAudit_Click
End Sub
-ted