I have created a 2 page report with two images on the first page. One is an embedded image (our company logo) in the page footer, and the other is a hyperlink image in the detail based on the link in a field of the query used as a record source. To make sure the hyperlink for the 2nd image works properly, in the On Format event of the detail I have code: If Me.imgPhoto.Picture <> "(none)" Then Me.imgPhoto.Picture = Me!lnkPhotoLocation.
When I access the report through the navigation pane and print preview, then print to pdf, everything works wonderfully.
I have used both of the code strings below, but using either results in only one image showing (and it is inconsistent which image shows). The first iteration did work once. Once!
First iteration:
Dim PauseTime, Start
PauseTime = 15
DoCmd.OpenReport strRpt1, acViewReport
Do While Timer < Start + PauseTime
Loop
strNewFile1 = strReportFolder & strRpt1 & ".pdf"
DoCmd.OutputTo acOutputReport, strRpt1, acFormatPDF, strNewFile1, , , , acExportQualityPrint
DoCmd.Close acReport, strRpt1
Second iteration:
DoCmd.OpenReport strRpt1, acViewReport
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, strRpt1
I am at a loss as to how to make the report work correctly! Any help would be greatly appreciated.