A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DoCmd.OpenReport error 2501



 
 
Thread Tools Display Modes
  #1  
Old May 8th, 2007, 12:35 PM posted to microsoft.public.access.reports
Tony Girgenti
external usenet poster
 
Posts: 11
Default DoCmd.OpenReport error 2501

Hello.

Using Access 2002 on Windows XP Pro, SP2 computer.

When running the code at the end of this post, it blows up on the
DoCmd.OpenReport with error 2501.

I can't figure out why. I tried searching for that error with no luck.

This problem only occurs on one computer. The same program works for
everyone else on the LAN. It is being run from a network drive.

Any help would be gratefully appreciated.

Thanks,
Tony

If strWhere = " " Then
DoCmd.OpenReport stDocName, acViewPreview
Else
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
End If

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:

If Err.Number 2501 Then
MsgBox Err.DESCRIPTION
End If

On Error GoTo 0

Resume Exit_Command2_Click

End Sub


  #2  
Old May 8th, 2007, 05:19 PM posted to microsoft.public.access.reports
Carl Rapson
external usenet poster
 
Posts: 517
Default DoCmd.OpenReport error 2501

"Tony Girgenti" wrote in message
...
Hello.

Using Access 2002 on Windows XP Pro, SP2 computer.

When running the code at the end of this post, it blows up on the
DoCmd.OpenReport with error 2501.

I can't figure out why. I tried searching for that error with no luck.

This problem only occurs on one computer. The same program works for
everyone else on the LAN. It is being run from a network drive.

Any help would be gratefully appreciated.

Thanks,
Tony

If strWhere = " " Then
DoCmd.OpenReport stDocName, acViewPreview
Else
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
End If

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:

If Err.Number 2501 Then
MsgBox Err.DESCRIPTION
End If

On Error GoTo 0

Resume Exit_Command2_Click

End Sub


One common cause of reports not working for a single user is that the user
doesn't have a default printer defined for Windows. You can check that, and
you can also try setting a different printer as the default printer.

Carl Rapson


  #3  
Old May 9th, 2007, 06:41 PM posted to microsoft.public.access.reports
Tony Girgenti
external usenet poster
 
Posts: 11
Default DoCmd.OpenReport error 2501

Hello Carl.

Thanks for your help with this. Sure enough, that was the problem.

This one workstation is the only one that has a barcode printer attached to
it and the barcode printer was set as the default. As soon as we changed
the default printer to a laser printer, it allowed this workstation to view
the Access reports.

Do you have any idea of how to handle this problem if they want to leave the
default as the barcode printer? I mean how can we make it so that the
default printer is set to the laser when they go to the Access reports? I
know we can do it manually before going to Access.

Any help would be gratefully appreciated.

Thanks,
Tony

"Carl Rapson" wrote in message
...
"Tony Girgenti" wrote in message
...
Hello.

Using Access 2002 on Windows XP Pro, SP2 computer.

When running the code at the end of this post, it blows up on the
DoCmd.OpenReport with error 2501.

I can't figure out why. I tried searching for that error with no luck.

This problem only occurs on one computer. The same program works for
everyone else on the LAN. It is being run from a network drive.

Any help would be gratefully appreciated.

Thanks,
Tony

If strWhere = " " Then
DoCmd.OpenReport stDocName, acViewPreview
Else
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
End If

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:

If Err.Number 2501 Then
MsgBox Err.DESCRIPTION
End If

On Error GoTo 0

Resume Exit_Command2_Click

End Sub


One common cause of reports not working for a single user is that the user
doesn't have a default printer defined for Windows. You can check that,
and you can also try setting a different printer as the default printer.

Carl Rapson




  #4  
Old May 9th, 2007, 10:57 PM posted to microsoft.public.access.reports
Carl Rapson
external usenet poster
 
Posts: 517
Default DoCmd.OpenReport error 2501

Unfortunately, I can't help you much there. I haven't encountered that
situation, so I don't know what the prodecure would be to change the default
printer in code. If you search this newsgroup for Printer you might find
some examples that will put you on track.

One thing I would suggest is to check the default printer at startup and
prompt the user to change it. You may have to have them change it manually,
but it should be possible to at least see what the default is. Look into the
Application.Printers collection.

Carl Rapson

"Tony Girgenti" wrote in message
...
Hello Carl.

Thanks for your help with this. Sure enough, that was the problem.

This one workstation is the only one that has a barcode printer attached
to it and the barcode printer was set as the default. As soon as we
changed the default printer to a laser printer, it allowed this
workstation to view the Access reports.

Do you have any idea of how to handle this problem if they want to leave
the default as the barcode printer? I mean how can we make it so that the
default printer is set to the laser when they go to the Access reports? I
know we can do it manually before going to Access.

Any help would be gratefully appreciated.

Thanks,
Tony

"Carl Rapson" wrote in message
...
"Tony Girgenti" wrote in message
...
Hello.

Using Access 2002 on Windows XP Pro, SP2 computer.

When running the code at the end of this post, it blows up on the
DoCmd.OpenReport with error 2501.

I can't figure out why. I tried searching for that error with no luck.

This problem only occurs on one computer. The same program works for
everyone else on the LAN. It is being run from a network drive.

Any help would be gratefully appreciated.

Thanks,
Tony

If strWhere = " " Then
DoCmd.OpenReport stDocName, acViewPreview
Else
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
End If

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:

If Err.Number 2501 Then
MsgBox Err.DESCRIPTION
End If

On Error GoTo 0

Resume Exit_Command2_Click

End Sub


One common cause of reports not working for a single user is that the
user doesn't have a default printer defined for Windows. You can check
that, and you can also try setting a different printer as the default
printer.

Carl Rapson






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.