D
Dale Fye
Access 2003, SP2.
I've recently started having probems with several of my VBA routines not
working properly. I've got some in-line error checking in a couple of places
in an Access application and an Excel Macro.
In one instance, I use the following code to allow a Cancel if there is no
data for the report, but I get a "2501 OpenReport action was cancelled" error
message on the OpenReport line of code.
On Error Resume Next
DoCmd.OpenReport "rpt_Circular_References", acViewPreview
If Err.Number = 2501 then
msgbox "No data to display in report"
Else
msgbox err.number & vbcrlf & err.description
Endif
On Error Goto ReportHandler
In another instance I used the following lines of code to make sure that the
MyFile command bar did not exist, before creating it again, but got an error
on the line that does the deletion (when the command bar did not already
exist):
On Error Resume Next
application.Commandbars("MyFile").Delete
On Error Goto ReportHandler
Any ideas?
I've recently started having probems with several of my VBA routines not
working properly. I've got some in-line error checking in a couple of places
in an Access application and an Excel Macro.
In one instance, I use the following code to allow a Cancel if there is no
data for the report, but I get a "2501 OpenReport action was cancelled" error
message on the OpenReport line of code.
On Error Resume Next
DoCmd.OpenReport "rpt_Circular_References", acViewPreview
If Err.Number = 2501 then
msgbox "No data to display in report"
Else
msgbox err.number & vbcrlf & err.description
Endif
On Error Goto ReportHandler
In another instance I used the following lines of code to make sure that the
MyFile command bar did not exist, before creating it again, but got an error
on the line that does the deletion (when the command bar did not already
exist):
On Error Resume Next
application.Commandbars("MyFile").Delete
On Error Goto ReportHandler
Any ideas?