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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Page event only works on page 2 onwards

Status
Not open for further replies.

CCTechy

IS-IT--Management
Jun 26, 2006
2
GB
Hi,
I am producing a report showing multiple records with two sub reports on each page. Each page will have images that associated with the first subform. (I'm sure most of this info is irrelevant).
So here's the problem, I am using the following code (I know it's a bit messy!) and it works on page two onwards but for some reason it does not on page one.

Private Sub Report_Page()
On Error Resume Next
Pre1.Picture = "i:\none.gif"
post1.Picture = "i:\none.gif"
Pre1.Picture = "i:\" & Me!JID & "1pre.jpg"
post1.Picture = "i:\" & Me!JID & "1post.jpg"
Pre2.Picture = "i:\none.gif"
post2.Picture = "i:\none.gif"
Pre2.Picture = "i:\" & Me!JID & "2pre.jpg"
post2.Picture = "i:\" & Me!JID & "2post.jpg"
Pre3.Picture = "i:\none.gif"
post3.Picture = "i:\none.gif"
Pre3.Picture = "i:\" & Me!JID & "3pre.jpg"
post3.Picture = "i:\" & Me!JID & "3post.jpg"
Pre4.Picture = "i:\none.gif"
post4.Picture = "i:\none.gif"
Pre4.Picture = "i:\" & Me!JID & "4pre.jpg"
post4.Picture = "i:\" & Me!JID & "4post.jpg"
pre5.Picture = "i:\none.gif"
post5.Picture = "i:\none.gif"
pre5.Picture = "i:\" & Me!JID & "5pre.jpg"
post5.Picture = "i:\" & Me!JID & "5post.jpg"
End Sub

Any suggestions?

Thanks.
 
I would place the code in the On Print event of the section containing the image controls.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for that suggestion, at first I could not understand what you meant, but I have now realsied what you were talking about.
I had been placing code on the OnPage event on the report itself, but by using the OnPrint trigger on the report's detail all appears to be working as I wanted.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top