Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specify page number 1

Status
Not open for further replies.

natrluvr

Technical User
Jun 19, 2002
15
US
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?

Any help would be appreciated.
 
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.

Paul
 
In the Page footer you can put a textbox. Then in Format event for the Footer put this
Me.TextboxName = "Page " & Me.Page + (I -1)

Where I is a value you could pass to the report from an input box. This will do what you want.

Paul
 
Paul

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
Sarah
 
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.

Paul
 
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.

Thanks again.

Sarah
 
Paul -

Thank you for all your help. I solved my last problem. The form had allow edits and additions set to no.

Thank you again.

Sarah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top