picture in report

S

shank

I'm trying to build a report with pictures. I found the below code online.
It 'kinda' works. One of the quirks is that if I hold my mouse over the
reports name in the DB manager, the screen starts flickering like it's
pre-loading pictures before I double-click it. Next quirk is that whne I do
initiate it, it will load a couple pages then crash Access. Not good! Is the
below just way to simple to get done what I need?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me![DiscIcon].Picture = Me![Pic]
End Sub

thanks!
 
S

shank

Addendum: I moved the below into the OnPrint event. Some things seem to
smooth out a bit. But it still crashes. I found that it crashes if there's
no picture at the location of the link provided. How can I change the code
so that if there's no picture, it ignores it?
thanks!
 
L

Larry Linson

You can use the Dir statement to see if it returns a filename using the path
and filename in [Pic]. If it does not, then do not set the Picture property,
or, perhaps even better, set it to the path and filename of a graphic that
says "No Picture".

Larry Linson
Microsoft Access MVP


shank said:
Addendum: I moved the below into the OnPrint event. Some things seem to
smooth out a bit. But it still crashes. I found that it crashes if there's
no picture at the location of the link provided. How can I change the code
so that if there's no picture, it ignores it?
thanks!

shank said:
I'm trying to build a report with pictures. I found the below code
online.
It 'kinda' works. One of the quirks is that if I hold my mouse over the
reports name in the DB manager, the screen starts flickering like it's
pre-loading pictures before I double-click it. Next quirk is that whne I
do
initiate it, it will load a couple pages then crash Access. Not good! Is
the
below just way to simple to get done what I need?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me![DiscIcon].Picture = Me![Pic]
End Sub

thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top