Pictures in reports

lskuff

Registered User.
Local time
Today, 03:07
Joined
Aug 10, 2003
Messages
14
Changing Pictures in reports (I need help fast-deadline)

I need to know how I can make a picture on a report change depending on what the value of something is. I am making a report that people can print to give out as certificates for completing a seminar course. And on the certificate there is a picture (a signature) and depending on what course the certificate is for I need a different picture. Anyone have any help?
 
Last edited:
Add a picture table to your database with two fields,
key(primary key text) and path(text)).

The key will be the course identifier and path is a string location of the file.

Assuming the size of the picture table is quite small you can use a DLOOKUP function to retrieve the value, alternatively, you could retrieve it by including the picture table in the reports record source and set an image objects path based on that. I've tried it and it works using this code:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Me.imgPicture.Picture = Me.Path
End Sub


Where imgPicture is the object and Me.Path is the picture path.

Be warned - do not try and do this with a lots of records or your machine will lock while Access tries to import various pictures - it really isn't the best at handling graphics you know.
 

Users who are viewing this thread

Back
Top Bottom