Now to change graphics automatic I a Report (1 Viewer)

dedwards1960

Registered User.
Local time
Today, 10:36
Joined
Jun 21, 2006
Messages
27
I have a report which prints out certificates for trade groups. I have two graphic images in this design and I would like them to change when selecting a different trade group.

Example would be. I what to print the certificates for Sail Trade and put the sailing image in the certificate. Now I want to print certificates for Gunnery Trade and I want the gunnery image now on the certificate.

Rather then creating numerous certificate reports I would like to use just one but change the graphic image when selecting a different trade.

Can this be done??? Or am i stuck creating certificates for all the trades I have.

Thanks
 

Banana

split with a cherry atop.
Local time
Today, 10:36
Joined
Sep 1, 2005
Messages
6,318
I'd create a table holding a autonumber column and a field holding the path name to each graphic images. In report's On Format, use VBA to look up the autonumber and retrieve the path name to place on the report.

HTH.
 

Banana

split with a cherry atop.
Local time
Today, 10:36
Joined
Sep 1, 2005
Messages
6,318
Please do not PM me; the idea is to allow everyone to benefit from the forums.

Anyway- you said:

Thanks for that. I have created a table and made the images ole object type.

Can you assist on the code. if have some idea on now this works. But could you give me and idea.

this is what I think is what is should be like.

If Me.txtTrade = 17 Then
Me.txtShowImage = [Logo and Art].[imagetype].1
Else
Me.txtShowImage = ""
End If

thanks Am I on the right track

I do not have Access with me so I cannot test it myself. Maybe someone will try it out or I will get around it when I have Access handy.

That said, I was envisioning referring a image by accessing its file path; I've never heard of a method called ShowImage, as I've never had opportunity to dynamically handle my images up to now. I will find out more when I have Access.

That is another good reason to post- sometime one user doesn't have all the answers but other can chip in.

HTH.
 

dedwards1960

Registered User.
Local time
Today, 10:36
Joined
Jun 21, 2006
Messages
27
OPk Thank

Just thought this would be faster. I am playing with this as you suggested but still can not get the image to change. I will see if I can find something to help me in this forum.

Thanks for your help.
Always appreciate any help.

Banana said:
Please do not PM me; the idea is to allow everyone to benefit from the forums.

Anyway- you said:



I do not have Access with me so I cannot test it myself. Maybe someone will try it out or I will get around it when I have Access handy.

That said, I was envisioning referring a image by accessing its file path; I've never heard of a method called ShowImage, as I've never had opportunity to dynamically handle my images up to now. I will find out more when I have Access.

That is another good reason to post- sometime one user doesn't have all the answers but other can chip in.

HTH.
 

dedwards1960

Registered User.
Local time
Today, 10:36
Joined
Jun 21, 2006
Messages
27
Solution I found Works

I played around with this and I created an event procedure that works.

There maybe an easier way of doing this.
Like they say if is not broke dont fix it.

Here is the code I am using:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.txtCourseType = 14 Then
' Directory where images are stored
Me.Image1.Picture = "M:\images\sail.bmp"
Me.Image2.Picture = "M:\images\sail.bmp"
Else

Me.Image1.Picture = ""
Me.Image2.Picture = ""

End Sub

Thanks to everyone that pointed me in the right direction and also to all the other members looking for ways to change images.
 

Users who are viewing this thread

Top Bottom