Error 2501

G

Guest

Good morning,

I'm having a compatibility issue (I believe) between 2000 and 2003. I use
the following sub to open a selected report form a listbox.

Private Sub lstReports_DblClick(Cancel As Integer)
On Error GoTo lstReports_DblClick_Error

'Open report based on user selection
Dim strRptName As String
strRptName = Me.lstReports

If Not IsNull(strRptName) Then
If strRptName = "Drawings Forecasted per Week" Then
DoCmd.OpenForm "Forecast Rpt Date Selection Frm", acNormal
ElseIf Left(strRptName, 5) = "DRM -" Then
DoCmd.OpenForm "DRM Report Form", acNormal
Else
DoCmd.OpenReport Me.lstReports, acViewPreview
End If
End If

On Error GoTo 0
Exit Sub

lstReports_DblClick_Error:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: Form_Report Selection Frm /
lstReports_DblClick" & vbCrLf & _
"Error Description: " & Err.Description, vbCritical, "An Error has
Occured!"
Resume Next

End Sub

It works fine for any user running on access 2000. It also workd fine on my
personal laptop running access 2003. However, a specific user running access
2003 keeps getting error 2501- The OpenReport action was cancelled. When she
work on another computer with 2000 it works. This leads me to believe it is
a 2003 thing?! But then why does it wok fine for me?

Another particular thing with her computer is the fact that she get prompted
with 3 dialogs when she open the db. A security warning about blocking
unsafe expressions, something a jet and then the standard message confirming
opening this file... The first 2 dialog do not appear for anyone else...
Is this a config issue with her pc? Does anyone know what might be the
problem in this case?

Is "DoCmd.OpenReport Me.lstReports, acViewPreview" an acceptable command in
both 2000 and 2003? or should I be using another command instead?

Thanking you in advance for your help,

Daniel
 
G

Guest

If she is getting those messages, Macro Security is set too high. Form the
main menu bar, Tools, Macro, Security.
 
A

Allen Browne

To solve the issue with the dialogs on startup, go to:
Tools | Macro | Security
and choose Low. That puts you in the same place as Access 2002 and 2000.

Now to figure why the report won't open. Can you open it from the database
window? I'm guessing that this probably won't work either. If that is the
case, there is probably an issue with the default printer. Access uses the
printer driver metrics to calculate the layout of the report. If there is no
printer installed, it can't figure out the report, and you get the behavior
you describe.

This also happens if there is a problem with the printer driver, and it
seems to be especially an issue with Access 2003 and network printers, and
it happens even on systems where other programs (such as Word) can print
okay. To verify that this is the problem, install any local printer (such as
an old Epson.) You don't actually have to get a printer: just install the
driver, and set it as the default printer. If the report now previews okay,
this is the issue. From there, it's a matter of getting a correct printer
driver, installing it correctly, or running with adequate permissions for
the printer.
 
G

Guest

The security was set at Medium. Only when I set it to low (for testing
purposes only) did the messages go away???

As far as the underlying issue. I am flabergasted, it was a printer
permission issue! The last place I would have been inclined to look. Thank
you so very much for your help!!!!!!!

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top