I have a form to select a specific report to print. In the form the user first selects a patient from a list box and then a date from a combo box. If the user clicks the print button without selecting the patient or date, message boxes appear. My problem is if the user prints or previews the report, and then selects another patient, the message box for the date does not appear the second and subsequent times.
Private Sub PrintNsgRpt_Click()
If IsNull(Me![SelectPt]) Then
MsgBox "Please select patient."
End If
If IsNull(Me![SelectDate]) Then
MsgBox "Please select visit date."
Else
Dim WClause
WClause = "[ContactID]=" & [SelectPt]
DoCmd.OpenReport ReportName:="Nursing Report", _
WhereCondition:=WClause, View:=Me![PrintorPreview]
End If
End Sub
Hoping you can help.
Private Sub PrintNsgRpt_Click()
If IsNull(Me![SelectPt]) Then
MsgBox "Please select patient."
End If
If IsNull(Me![SelectDate]) Then
MsgBox "Please select visit date."
Else
Dim WClause
WClause = "[ContactID]=" & [SelectPt]
DoCmd.OpenReport ReportName:="Nursing Report", _
WhereCondition:=WClause, View:=Me![PrintorPreview]
End If
End Sub
Hoping you can help.