none
Access report name misspelled or does not exist RRS feed

  • Question

  • I get the error below:

           With Reports!Report1 - errors out on this line "report name is misspelled or does not exist"
            .FilterOn = True
            .ServerFilter = Criteria
            End With

    - I double checked the report name and it is correct.

    Thanks


    Charles Stratton

    Monday, August 24, 2015 3:56 PM

Answers

  • Hi Charles,

    >> errors out on this line "report name is misspelled or does not exist"

    I made a test with your code, and I reproduced your issue. I assume that before you call this code, you did not open the Report1, am I right? According to the error message, you need to open the Report1 before you call this code. You could try the code below.

    Sub ReportFun()
    'check whether the report is open
        If Application.CurrentProject.AllReports("Report1").IsLoaded = False Then
        'if not, open the report
        DoCmd.OpenReport "Report1", acViewReport
        End If
        With Reports!Report1
             .FilterOn = True
             .ServerFilter = Criteria
        End With
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, August 25, 2015 2:49 AM

All replies

  • Is the report open for editing?


    See my comments in your previous post...
    Monday, August 24, 2015 4:09 PM
  • The code will be in a utility class module that receives the criteria then opens the report. So when the database runs the report won't be in design view. what are my options where I want to pass criteria to the .ServerFilter it works in design mode, but not running?

    thanks,


    Charles Stratton

    Monday, August 24, 2015 5:07 PM
  • Hi Charles,

    >> errors out on this line "report name is misspelled or does not exist"

    I made a test with your code, and I reproduced your issue. I assume that before you call this code, you did not open the Report1, am I right? According to the error message, you need to open the Report1 before you call this code. You could try the code below.

    Sub ReportFun()
    'check whether the report is open
        If Application.CurrentProject.AllReports("Report1").IsLoaded = False Then
        'if not, open the report
        DoCmd.OpenReport "Report1", acViewReport
        End If
        With Reports!Report1
             .FilterOn = True
             .ServerFilter = Criteria
        End With
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, August 25, 2015 2:49 AM