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 


0
Tony
5/8/2007 11:35:04 AM
access.reports 4434 articles. 0 followers. Follow

3 Replies
2615 Views

Similar Articles

[PageSpeed] 26

"Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message 
news:ObvWtTWkHHA.2552@TK2MSFTNGP06.phx.gbl...
> 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


0
Carl
5/8/2007 4:19:26 PM
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" <mr.mxyzptlk@newsgroups.nospam> wrote in message 
news:uGdrtyYkHHA.3816@TK2MSFTNGP02.phx.gbl...
> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message 
> news:ObvWtTWkHHA.2552@TK2MSFTNGP06.phx.gbl...
>> 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
>
> 


0
Tony
5/9/2007 5:41:56 PM
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" <tony(nospam)@lakesideos.com> wrote in message 
news:uJDVXFmkHHA.4248@TK2MSFTNGP06.phx.gbl...
> 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" <mr.mxyzptlk@newsgroups.nospam> wrote in message 
> news:uGdrtyYkHHA.3816@TK2MSFTNGP02.phx.gbl...
>> "Tony Girgenti" <tony(nospam)@lakesideos.com> wrote in message 
>> news:ObvWtTWkHHA.2552@TK2MSFTNGP06.phx.gbl...
>>> 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
>>
>>
>
> 


0
Carl
5/9/2007 9:57:48 PM
Reply:

Similar Artilces:

Backup Errors
When I try to backup GP in File > Backup, I get the error message "You must be on the server to perform this task". I did restore this database to a different machine. What do I have to do so I can backup again? -- Japheth Nolt Landis Computer www.landiscomputer.com PC Sales, Service & Helpdesk Certified Network Installation & Service Microsoft Retail Management System Microsoft Small Business Financials Specialists Microsoft Certified Partner Comp TIA PC Service Certified The machine you are trying to restore on might have had Dynamics GP installed as a wo...

error C2664.
Hi, i have an error in my application(vs2005). First i list .h and .cpp files and then i provide error description. If anybody know the solution please help me out. *************modifymediapage.h************** #include <vector> class Cmodifymediapage { ....; private: vector<CString> & m_vFieldVals; }; ****************modifymediapage.cpp**************** //this gives index of combo box selection int iPageSelect = m_PageNumber.GetCurSel(); if(m_vFieldVals.size()>=(iPageSelect+1)) { m_vFieldVals.erase(&m_vFieldVals[iPageSelect]);//error pointing here...

error 0x8004210a
Hi, I have a error 0x8004210a in my outlook 2002 in my notebook Vaio (Win XP Pro). Download SP2 office xp and nothings. Other Pc I have run outlook 2002 with norton 2003 and not a problem. Please help me. THanks wong ...

errors on disk
Greetings, My Mcafee scan has frozen the pc 3 times in the same place, and the Mcafee tech said there are some errors on the disk that could cause this. There is a "scandisk" on xp and earlier versions, is there something similar on Vista? What else can I do to identify and correct these errors? Thanks, JS JS wrote: > My Mcafee scan has frozen the pc 3 times in the same place, and the > Mcafee tech said there are some errors on the disk that could cause > this. There is a "scandisk" on xp and earlier versions, is there > something similar on Vi...

How convert Docmd.Domenuitem
I'm converting a 97 db to 2000. A form has a button that executes a Docmd.Domenuitem command. This is supposed to invoke Find and Replace. It does, but the subject is grayed out. I need the find to be based on the control where the cursor was when the button was pressed. Any ideas? Access help in 2000 does not even mention this command neither does my Access book. Maybe you need to do Screen.PreviousControl.SetFocus DoCmd.RunCommand acCmdFind or DoCmd.FindRecord On Thu, 29 Sep 2005 13:43:03 -0700, "mscertified" <rupert@tigerlily.com> wrote: >I'm converti...

Stock Status Valuation errors...
Can someone tell me the calculations that take place in the Inventory Stock Status report in order to create the Inventory Valuation? We have several items that show an On-Hand value of Zero (0) which is correct, yet the Inventory Valuation has some value which is in some cases POSITIVE and in others NEGATIVE. Using the Resources capability, I have displayed the Report Layout for the Stock Status, but cannot seem to find the actual CALCULATIONS for creating the Inventory Value. (There are multiple Quantity Fields including On-Hand, but in the records that I am tracking (using SQL Ente...

Visual Basic Error
Every time I shut down Outlook, I now get the following Microsoft Visual Basic error: "Compile error in hidden module: Autoexec" This started after I installed the software for People PC Dial -up Service. They haven't responded to my question and Tech Net/Knowledge base come up empty. Help!!! Thanks So, uninstall that software. It's obviously the problem and if they won't support it then it's useless to you. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Exten...

Copying Sheets causes errors
I have a quite extensive Excel workbook that I am using to track data and changes. I had made changes to a coupld of the pages on an older version of the document and wanted to keep those changes so I copied the sheets that I needed to the more current version of the document. As a result I have inadvertantly created links to the older version and it is messing me up. I have tried useing the "Break Links" under Edit and that doesn't seem to do anything. I am not wanting to have to redo everything but it looks like I am left with that being the only option. Does anyone...

Run-time error 70
Hello, =============== From help file: Permission denied (Error 70) An attempt was made to write to a write-protected disk or to access a locked file ================ I have received that from user using my app in Windows 7. After tracing the problem I have found only one relevant place in source code is when writing data to this location: c:\Users\<user name>\AppData\Roaming\<app name> However the routine writing to that location has error handling enabled (On Error Resume Next) My question is: Is it possible to have that run-time error displayed (popped-up) des...

OpenReport + Current Record Only
Ive read like 20 other posts regarding this issue & tried all the code variations provided in them although I cannot get the OpenReport command to open the report with only the current record. The following is the code that is always the "one that works" as ive read in the other posts; DoCmd.OpenReport "Report_Name", acViewPreview, , "Report_ID_Field = "" & Me.Form_ID_Field""" For me it brings up a blank report each time. This next variation prompts me for the 'Form Field' parameter DoCmd.OpenReport "Report_Name", ...

just look at this error/com add-in
After putting in a new hard disk and restoring my info with files and settings transfer wizard I have but one bug. When I open outlook I get this box with this message. I click ok or x it out and outlook runs normally. Here goes. 'C:\documents and settings\sammycastagna\application data\microsoft\addins\C:\program files\micros~2\office 10 addins\outbak.dll' is not a valid office add-in. When I push the com add-in tab I get the same error message as outlook startup. But there is nothing to clear. Tried renaming extend.dat uninstalling and reinstalling Office XP nothing so far...

Dex runtime error after adding modified smart list to vba
My first go round I had added the "original" Smartlist lookup for Inventory/Items to visual basic instead of adding a "modified" Smartlist Lookup for this screen. This worked fine, but I realized I didn't want all users to use the modified Smartlist. I then removed all these changes and tried to start fresh. I then added the original smartlist to Modifier. This was ok. I changed security to use the modified window. However, after adding the modified window, when I try to exit the screen, I get the Dexterity runtime error. I have repeated this seve...

worksheet with same name error
I have a macro that I use to make a copy of the active worksheet . It works great, if I run the macro again with the same value in "f4", I get a vb error. Is there a way to check the name in "f4" against all worksheet names (there could be 50 sheets) and trap the error? Dim my_sheet As String my_sheet = Range("f4").Value ActiveSheet.Copy After:=Sheets(1) ActiveSheet.Name = my_sheet I will then use: MsgBox "Sheet Saved", vbOKOnly + vbExclamation Else MsgBox "Duplicate name Sheet Not Saved", _ vbOKOnly + vbExclamation End If End...

Is it true about DoCmd.SendObject
That DoCmd.SendObject will find your default Mail client? -- Thanks in advance for any help with this......Bob MS Access 2007 accdb Windows XP Home Edition Ver 5.1 Service Pack 3 "Bob Vance" <rjvance@ihug.co.nz> wrote in message news:u91TwlG3KHA.4964@TK2MSFTNGP05.phx.gbl... > That DoCmd.SendObject will find your default Mail client? > > -- > Thanks in advance for any help with this......Bob > MS Access 2007 accdb > Windows XP Home Edition Ver 5.1 Service Pack 3 > > It's true if your default Mail client is Outlook :~) ...

Office 2003 Upgrade - Error 1608
I'm trying to install Office 2003 Small Business Upgrade on Windows 7. I have Office XP (2002) already installed (Student & Teacher version). When I go to install the upgrade, I get the error message 1608 that "Setup could not locate a version of Microsoft Office 97, 2000 or XP on the selected drive. As mentioned, the suite IS installed on my C:\ drive. I also tried inserting the Office XP installation CD, but get the same error message. Please advise what I should do. Probably because Office XP Student and Teacher Edition is not a qualifying upgrade product f...

Error Message #34
I am getting a Error Message that I have lost my connection to server or not connected and I keep getting the same emails delivered from two days ago when I was just getting the Error Message. I delete them and they come back with the error message at the end. I have contacted my server and they say it has to be a problem with Outlook as I am connected. Any suggestions. I am on Windows 2000 XP and have the latest versions of Exployer and Outlook updated ...

Error Posting to table POP10110. Restore from backup . . .
Client recently upgraded from GP Standard without inventory to GP BRL- Advanced Management with inventory. Consequently, existing POs in the system have no site ID assigned to them. POs have previous receipts against them (prior to upgrade). Now, when a subsequent receipt is made against the PO, they get **ERROR: Posting to table POP10110. Restore from backup if possible. I tested receiving against a new PO - no error. I tested receiving against an existing PO and entering a Site ID in the receiving transaction - error occurs. I can't update the existing POs to add the Site ID beca...

Startup error
I have Win 7 Home Premium, x64. Recently, I installed Windows Live Essential (beta). Right after that, every time I restart my computer, I get a message : WISTARTUP.EXE - Entry Point Not Found. "The procedure entry point ?RMLoadColorReg@YGKPBDPB_WKKK@Z could not be located in the dynamic link library UXCore.dll." After closing this message, launching of Windows continues and I see no other problems. What this is all about? How to correct this problem and have Windows start normally? Ilya Zeldes, Fort Myers, Florida Ilya, I have found this thread: http://www.windowsl...

Update Error number: 0x8024002E
I'm running Windows XP SP3 on a laptop that has restrictive group policies. I managed to hack the registry to enable the group policy editor and set it to allow access to Windows Update. I used this to install SP3 (it was on SP2) and Dot Net 3.5, but now I can't get get the Update web page to display. I've searched the net and tried everything I can think of and it's driving me nuts. Update log is as follows: Misc =========== Logging initialized (build: 7.4.7600.226, tz: +1000) =========== 2010-03-14 16:10:19:312 3880 4a8 Misc = Process: C:\Program Fi...

Managed MAPI Service Catastrophic Failure error
When I reboot my computer or the computer has been on for awhile I get an error message that reads "'Managed MAPI Service Catastrophic Failure error' 'Unknown error'" This started after I installed Norton Internet Security 2005. When I try to send email I get an error that reads "The Specified server was found, but there was no response from the server. Please verify that the port and SSL information is correct. This also started after installing Norton Internet Security 2005. I can send email fine using Outlook Express. My ISP is Earthlink through Tim...

error message with emails
Whenever I send or reply to an email an error message appears says outlook cannot find MS09.dll. It then wants to send an error report to Microsoft. I have tried completely reinstaling Office 2003, repairing it, but nothing seems to work. Can anyone help please? Brian ...

Trapping Errors from an InputBox
Good evening all ... I know there as to be a way ... but I have not had any luck. I have an inputbox that works great if your selection within the indicated number ... but lots of times, you get bit by the "number lock" issue and the program haults with Run-time error '13': Type mismatch. Is there a way to "trap" this error and return to the inputbox without blowing up? Thanks in advance -- Jerry Try something like Dim MyNum as Variant, I as Boolean I = False ' Loop until number is entered While Not I = True MyNum=InputBox("Please select a num...

Event Viewer ID 9348 and Error 8004010F
We have reset our system folders on and Exchange Server 2003 (MS KB 822444) because of the errors listed below. After resetting the system folders we are still receiving the error messages and have found that in ADSI Edit there are duplicate records for the 403 and 81A records listed. The first of each is just 403 and 81A with the related information in the right-hand pane. The other two are listed as CN=403 CNF:1ba8fd50-0f60-48a8-89d0-ce36b85b9397 and CN=81A CNF:4be6223e-5a74-45ed-b8a5-cf5d17e844a3 with nothing in the right-hand pane. Can these two items be safely deleted from ADSI Edit? ...

Error when sending e-mails from CRM (Server Error in '/' Applicati
i am getting below error message whenever sending email from CRM. could anyone help me in this regard. Runtime Error: Description:An Application errro occured on the server teh current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reason). it could, however be viewed by browser running on the local server machine. Regards, Syed. Run the application from server or check the event viewer application log for actual error details. Thanks Rakesh Narayan "SyedAbdulbasith" wrote: > i am getting ...

Help with "Form DoCmd.Open and DoCmd.Close
The following two lines of code is not operating correctly. Private Sub cmdChangeVendor1_Click() DoCmd.Close acForm, "Invoice by Market Reviewer" DoCmd.OpenForm "Selections Vendor and Reviewer", acNormal End Sub When I click on the cmdChangeVendor1 button, I expect the form "Invoice by Market Reviewer" to close and the form "Selections Vendor and Reviewer" to open. But that is not the result I get. The form "Invoice by Market Reviewer" closes but that is about it. Nothing else opens. I have two forms that behaves this way. I have ...