Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report 2501 Error (A2003 SP2)

    I have a problem with an Access report which generates a 2501 error message for the user.

    This is an application which I have written for a user who works in another location. There are 2 reports in it which are opened in Preview mode by clicking a command button. These work fine for me, and they also work for me when I copy the mdb to the user's network folder, and run it from there.

    However... When the user runs it she gets the 2501 Error when the report opens. There is data in the report, BTW. I have googled the problem & thought it might be connected to the default printer setting. As a result I have added this code :

    Set prt = Application.Printer
    DoCmd.OpenReport "rptGLCode", acViewDesign, , , acHidden
    Set rpt = Reports("rptGLCode")
    rpt.Printer = prt
    DoCmd.Close acReport, rpt.Name, acSaveYes
    DoCmd.OpenReport "rptGLCode", acViewPreview
    Set Application.Printer = prt

    For me it works fine, for the user the error occurs on the second line.

    Can anyone help with any suggestions as to how to get round this. All help gratefully received.

    Nick

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Report 2501 Error (A2003 SP2)

    Is the database used by more than one user? If so, it is not a good idea to open a report in design view.

    Do you have code in the On No Data event of the report? This would cause the error message if the report is canceled because there are no data to display. You can get around this by using an error handler:

    ...
    On Error GoTo ErrHandler
    ...
    DoCmd.OpenReport ...
    ...
    Exit Sub

    ErrHandler:
    If Err = 2501 Then
    ' Ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report 2501 Error (A2003 SP2)

    Hans

    Thanks for that. I added the code, but the problem was still there.

    I did some more investigation on the user's PC, and it appears there is a problem with the Access installation - she cannot create any reports at all, even on 1 table databases. Hopefully when Access has been re-installed the problem will be solved.

    Nick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •