how do i set an images "picture" property in a report using code (1 Viewer)

Funkyaccess

Registered User.
Local time
Yesterday, 23:40
Joined
Oct 8, 2009
Messages
69
HI

I have this bit of code

Private Sub Report_Open(Cancel As Integer)
Me.imgLogo.Report.Picture = gblIMAGEPath & "logo3.gif"

I get run-time 2455 you enters an expression that has an invalid reference to the property Form/report.

Any ideas?
 

ByteMyzer

AWF VIP
Local time
Yesterday, 23:40
Joined
May 3, 2004
Messages
1,409
Try changing your code to:
Code:
Me.imgLogo.Picture = gblIMAGEPath & "logo3.gif"
 

Funkyaccess

Registered User.
Local time
Yesterday, 23:40
Joined
Oct 8, 2009
Messages
69
I thought that was a answer as well because I have a form that uses the logo but on my report whe n I type Me.imgLogo. it gives me other options and Picture is not one of them. I only found the Picture attribute when I used .Report
 

ByteMyzer

AWF VIP
Local time
Yesterday, 23:40
Joined
May 3, 2004
Messages
1,409
You won't see it offered automatically as an option, but the VBA interpreter still recognizes it.

Try it and see if it works for you.
 

boblarson

Smeghead
Local time
Yesterday, 23:40
Joined
Jan 12, 2001
Messages
32,059
What ByteMyzer says is correct. Not all of the options come up in Intellisense, just like not all of the EVENTS that are available to you for most things are listed on the PROPERTIES dialog in design view. You can access more of them by using the drop downs in the top of the VBA window.

As for the picture, also make sure that there is a backslash in gblIMAGEPath

and if there isn't use

gblIMAGEPath & "\logo3.gif"
 

Users who are viewing this thread

Top Bottom