• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Advanced Report Techniques > Programmatically Manipulating Report S...

Programmatically Manipulating Report Sections

Not only can you create and manipulate report sections at design time, you also can do so at runtime. You must first open the report in Design view. You use the DoCmd object to add a report header and footer or a page header and footer. The code appears in Listing 10.11.

Listing 10.11. Using the DoCmd Object to Programmatically Add Sections to Reports at Runtime

Private Sub cmdAddHeadersFooters_Click()
    'Open rptAny in Design view
    DoCmd.OpenReport "rptAny", acViewDesign

    'Add a report header and footer
    DoCmd.RunCommand acCmdReportHdrFtr

    'Add a page header and footer
    DoCmd.RunCommand acCmdPageHdrFtr
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint