开发者

Running VBA in a Microsoft Access Report before Printing

开发者 https://www.devze.com 2023-03-21 09:43 出处:网络
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

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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号