1
votes

I've created a report which is used to display a customer's address along with a logo.

The logo filepath is stored in the customer record and is loaded into a picture using some vba in the On Load event.

Me!Image01.Picture = logoPath

This works fine when previewing but when using DoCmd.openReport and sending it straight to print the code is not run.

My question is how do I get the code, which works fine if executed, to run before the report is sent to the printer?

1

1 Answers

2
votes

If you put your code in the Detail_Format event, it should work.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me!Image01.Picture = logoPath
End Sub