• Access Report not calling all Event vba procedures, what’s up with that?

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access Report not calling all Event vba procedures, what’s up with that?

    Author
    Topic
    #488092

    I have two databases, Access 2010. In one, all the vba procedures written for the events in the report are executing correctly. In the other, only Report_Open and Report_Close are executing. Detail_Format, Detail_Print, PageHeaderSection_Format, ReportHeader_Format are not executing. I have not changed the default names of the parts of the report, so the sub names are correct.

    I know they are not executing because I have put debug.print statements in each, as well as MsgBox statements (might as well get told in two places, eh?). In fact, I have reduced these methods to merely the MsgBox and debug.print statements, and none is executed.

    Sample:
    Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
    MsgBox (“ReportHeader_Format”)
    Debug.Print “ReportHeader_Format”
    End Sub

    When I step through the code, starting in Report_Open, it just finishes Report_Open and displays the report.

    Can anyone give me a clue where to look for the problem?

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #1378093

      Are you opening the reports in Report Preview as opposed to Print Preview? VBA code does not run in Report Preview.

    • #1379867

      You are undoubtedly opening your report in a screen-oriented Report View or Layout View, rather than the long-time standard Print Preview. Format events fire only when Access is preparing send output to a printer. If Report View or Layout View is important to you, move or copy your code to corresponding Paint events. Paint events fire as you page through a report on the screen, whether in Report View or Layout View.

    Viewing 1 reply thread
    Reply To: Access Report not calling all Event vba procedures, what’s up with that?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: