(Msg. 1) Posted: Thu Oct 08, 2009 8:25 am
Post subject: Report page number resetting Archived from groups: microsoft>public>access>reports (more info?)
Hello everyone, I have a report that that will start a new page for each
Group in my report. Each group in this report represents a customer and its
activities. The page footer has the control to display the page number
sequentially. How can I force Access 2007 to start with page 1 (one) for each
customer? Some customer has enough data to fill more than one page and in
that case that customer report will have page 1 and page 2 then when the next
customer is printed the first page for that customer will be page 1 again and
so on. I know that sunning “individual” reports it will give me what I want I
would like to print all my data from a single report.
Thank you,
Silvio
(Msg. 2) Posted: Thu Oct 08, 2009 11:21 am
Post subject: Re: Report page number resetting [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Silvio wrote:
>Hello everyone, I have a report that that will start a new page for each
>Group in my report. Each group in this report represents a customer and its
>activities. The page footer has the control to display the page number
>sequentially. How can I force Access 2007 to start with page 1 (one) for each
>customer? Some customer has enough data to fill more than one page and in
>that case that customer report will have page 1 and page 2 then when the next
>customer is printed the first page for that customer will be page 1 again and
>so on. I know that sunning individual reports it will give me what I want I
>would like to print all my data from a single report.
Just add a line of code to the group header section's Format
or Print event procedure:
Me.Page = 1
(Msg. 3) Posted: Thu Oct 08, 2009 11:21 am
Post subject: Re: Report page number resetting [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thanks Marshall.
"Marshall Barton" wrote:
> Silvio wrote:
>
> >Hello everyone, I have a report that that will start a new page for each
> >Group in my report. Each group in this report represents a customer and its
> >activities. The page footer has the control to display the page number
> >sequentially. How can I force Access 2007 to start with page 1 (one) for each
> >customer? Some customer has enough data to fill more than one page and in
> >that case that customer report will have page 1 and page 2 then when the next
> >customer is printed the first page for that customer will be page 1 again and
> >so on. I know that sunning “individual” reports it will give me what I want I
> >would like to print all my data from a single report.
>
>
> Just add a line of code to the group header section's Format
> or Print event procedure:
> Me.Page = 1
>
> --
> Marsh
> MVP [MS Access]
>
(Msg. 4) Posted: Thu Oct 15, 2009 11:19 am
Post subject: Re: Report page number resetting [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
so I can get Page # of ## However, the code does not work for me for some
reason. I am trying to use it in Access 2007.
My report is set as follow:
Group on: Customer
Then the property of the Customer Header are:
Force New Page: Before Section
Repeat Section: Yes
Then the Page Footer has a control named ctlGrpPages and the Control Source
is:
="Page " & [Page] & " of " & [Pages]
The page Footer has the following event On Format:
Option Compare Database
Option Explicit
Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim i As Integer
If Me.Pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
GrpNameCurrent = Me.Customer
If GrpNameCurrent = GrpNamePrevious Then
GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
GrpPages = GrpArrayPage(Me.Page)
For i = Me.Page - ((GrpPages) - 1) To Me.Page
GrpArrayPages(i) = GrpPages
Next i
Else
GrpPage = 1
GrpArrayPage(Me.Page) = GrpPage
GrpArrayPages(Me.Page) = GrpPage
End If
Else
Me.ctlGrpPages = "Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)
End If
GrpNamePrevious = GrpNameCurrent
End Sub
The line I am getting stuck with is: Me.ctlGrpPages = "Page " &
GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
The message I am getting is Run-time error '-2147352567 (800200009)': You
can't assign a value to this object.
Any idea how to fic this?
"Marshall Barton" wrote:
> Silvio wrote:
>
> >Hello everyone, I have a report that that will start a new page for each
> >Group in my report. Each group in this report represents a customer and its
> >activities. The page footer has the control to display the page number
> >sequentially. How can I force Access 2007 to start with page 1 (one) for each
> >customer? Some customer has enough data to fill more than one page and in
> >that case that customer report will have page 1 and page 2 then when the next
> >customer is printed the first page for that customer will be page 1 again and
> >so on. I know that sunning “individual” reports it will give me what I want I
> >would like to print all my data from a single report.
>
>
> Just add a line of code to the group header section's Format
> or Print event procedure:
> Me.Page = 1
>
> --
> Marsh
> MVP [MS Access]
>
(Msg. 5) Posted: Fri Oct 16, 2009 1:47 pm
Post subject: Re: Report page number resetting [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Silvio wrote:
>Hi Marshall, I am trying to use the code from
>http://www.mvps.org/access/reports/rpt0013.htm
>
>so I can get Page # of ## However, the code does not work for me for some
>reason. I am trying to use it in Access 2007.
>
>My report is set as follow:
>
>Group on: Customer
>Then the property of the Customer Header are:
>Force New Page: Before Section
>Repeat Section: Yes
>
>Then the Page Footer has a control named ctlGrpPages and the Control Source
>is:
>="Page " & [Page] & " of " & [Pages]
>
>
>The page Footer has the following event On Format:
>
>Option Compare Database
>Option Explicit
>
>Dim GrpArrayPage(), GrpArrayPages()
>Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
>Dim GrpPage As Integer, GrpPages As Integer
>
>Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
>Integer)
>Dim i As Integer
> If Me.Pages = 0 Then
> ReDim Preserve GrpArrayPage(Me.Page + 1)
> ReDim Preserve GrpArrayPages(Me.Page + 1)
> GrpNameCurrent = Me.Customer
> If GrpNameCurrent = GrpNamePrevious Then
> GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
> GrpPages = GrpArrayPage(Me.Page)
> For i = Me.Page - ((GrpPages) - 1) To Me.Page
> GrpArrayPages(i) = GrpPages
> Next i
> Else
> GrpPage = 1
> GrpArrayPage(Me.Page) = GrpPage
> GrpArrayPages(Me.Page) = GrpPage
> End If
> Else
> Me.ctlGrpPages = "Page " & GrpArrayPage(Me.Page) & " of " &
>GrpArrayPages(Me.Page)
> End If
> GrpNamePrevious = GrpNameCurrent
>
>End Sub
>
>The line I am getting stuck with is: Me.ctlGrpPages = "Page " &
>GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
>
>The message I am getting is Run-time error '-2147352567 (800200009)': You
>can't assign a value to this object.
You can not set its value because the text box has an
expression that calculates its value. Remove the expression
in the text box's control source and then I think it might
work,
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum