Setting .page property in reports 
Author Message
 Setting .page property in reports

Hi. I'm having a problem setting the .page property in a report. I'm trying
to run several reports with consecutive page numbers throughout, and before
each report prints I want to set the page number to one more than the last
page of the previous report.

I could do this with a report/subreport, but the selection of reports varies
so I want to do in VBA.

Per MS help and references, I have two subs in a module like so  (message
boxes are for testing):

    public intLPN as integer

    Sub SetLPN(ReportName As Report)        'Run at end of report to stash
last page no.
        intLPN = ReportName.Page
        MsgBox "last page is " & intLPN
    End Sub

    Sub readLPN(ReportName As Report)    'Runs at start of report to set
page no.        ReportName.Page = intLPN + 1
        MsgBox "first page of this report is " & ReportName.Page
    End Sub

In each report, I have an event procedure on the ReportFooter_Format event:

    SetLPN Me

In the second and successive reports I have an ep on Report_Open event:

    ReadLPN Me

When I run both reports in succession, for the first it's picking up the
correct last page. For the second report, the message box displays the
correct .Page value, but when the report is displayed, its page number
starts at 1.

I'm not sure if it's the code that's screwed up or my selection of events.
Any help will be appreciated!



Mon, 08 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Host for Property Pages or Public Property Page

2. Host for Property Pages or Public Property Page

3. Setting shape custom prop to page's property

4. Setting an ActiveX-property from a web-page?

5. Programmatically Set Excel Page SetUp properties using VB

6. Setting property pages for usercontrol

7. How to set the ActiveX EXE Document (vbd) property in HTML (ASP) page

8. Programmatically Set Excel Page SetUp properties using VB

9. How control and setting Pages Per Sheet on Document Properties

10. How to pass page settings when open report?

11. Crystal Report Print a Set of Pages

12. Data Report page Setting

 

 
Powered by phpBB® Forum Software