Phredd
Registered User.
- Local time
- Tomorrow, 05:41
- Joined
- May 28, 2002
- Messages
- 34
I know this has been covered to death, and I think I have read every post.
My issue is although I think I am following all the advise, it appears my line
"On Error GoTo Errorhandler" is not being recognized.
I have put this line in many locations, and every time it just seems to skip or ignore it. :banghead:
Any ideas guys ? I have edited and include the code below...
-------------------
Private Sub Command300_Click()
On Error GoTo Errorhandler
If IsNull([Date Summary Sent]) Or IsNull([CompDate]) Or IsNull([Date Discharge]) Then
MsgBox "Please ensure you have Entered 'Date Sent', 'Completion Date', 'Discharge Date' and 'Name'."
Else
If Me.Dirty Then
Me.Dirty = False
End If
If [Discharge Medication] = True Then
On Error GoTo Errorhandler
strWhere = "[recordnumber] = " & Me.[RecordNumber]
DoCmd.OpenReport "Print Report", acViewPreview, , strWhere
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Print Report", acSaveNo
DoCmd.OpenReport "Rpt-Medicationform", acViewPreview, , strWhere
MsgBox "There is a Medication Summary Form attached to this report. Please select Printer & Number of copies required Then print"
On Error GoTo Errorhandler
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Rpt-Medicationform", acSaveNo
Else
strWhere = "[recordnumber] = " & Me.[RecordNumber]
DoCmd.OpenReport "Print Report", acViewPreview, , strWhere
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Print Report", acSaveNo
End If
Errorhandler:
If Err.Number = 2501 Then
MsgBox "You cancelled the print"
End If
End If
End Sub
---------------------------
My issue is although I think I am following all the advise, it appears my line
"On Error GoTo Errorhandler" is not being recognized.
I have put this line in many locations, and every time it just seems to skip or ignore it. :banghead:
Any ideas guys ? I have edited and include the code below...
-------------------
Private Sub Command300_Click()
On Error GoTo Errorhandler
If IsNull([Date Summary Sent]) Or IsNull([CompDate]) Or IsNull([Date Discharge]) Then
MsgBox "Please ensure you have Entered 'Date Sent', 'Completion Date', 'Discharge Date' and 'Name'."
Else
If Me.Dirty Then
Me.Dirty = False
End If
If [Discharge Medication] = True Then
On Error GoTo Errorhandler
strWhere = "[recordnumber] = " & Me.[RecordNumber]
DoCmd.OpenReport "Print Report", acViewPreview, , strWhere
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Print Report", acSaveNo
DoCmd.OpenReport "Rpt-Medicationform", acViewPreview, , strWhere
MsgBox "There is a Medication Summary Form attached to this report. Please select Printer & Number of copies required Then print"
On Error GoTo Errorhandler
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Rpt-Medicationform", acSaveNo
Else
strWhere = "[recordnumber] = " & Me.[RecordNumber]
DoCmd.OpenReport "Print Report", acViewPreview, , strWhere
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "Print Report", acSaveNo
End If
Errorhandler:
If Err.Number = 2501 Then
MsgBox "You cancelled the print"
End If
End If
End Sub
---------------------------
Last edited: