Is there a way to have a report ask a user what page number to begin with and then have it insert that requested page number into the page footer? it would also need to have each page go sequential with the given page number?
While I don't think you can manipulate the Page/Pages property of the report, I think you could mimick them. You don't need to show the page number as Access generates it. You could use an input box to collect the number and probably pass that to a textbox in the pagefooter that incremented by 1 for each page. I haven't tried it but it does seem feasible. When I get a few minutes I'll look at it closer.
Thank you. How do pass the value for I from an 'input box'? I put the code in the format event and it started the page number with 0? Is there something more I need to do to create an 'input box'?
Sarah, create a Form that has one textbox on it and a button for opening the Report. Then when you want to open the report open this form, insert the number in the textbox you want to start the Report with and then click the button. In the Format Event for the Page Footer of the Report put this
Dim I as Integer
I = Forms!FormName!TextboxName
If IsNull(I) Then
Exit Sub
Else
Me.TextBoxName = "Page " & Me.Page + (I-1)
End If
When I tried to use an InputBox it asked for the value each time the page formatted so if you have a 30 page report it prompted you 30 times for the value of I. Using the Form, the form is open when the report opens so the value for I is always available. Post back if you have problems.
I apologize if this is all basic and I am not quite getting it. I did as you said, however I cannot get the text box to allow a number to be added. It will let me set a default value so I can tell the code works that you gave me.
The form I added the text box to runs a variety of reports from it and I would like all the reports to be able to have this function.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.