How to programatically change the Picture property at runtime

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I want to programatically change the Picture property associated with an
Image object on a report at runtime... how and where would you do it ?

Tried On Format...
Me.imageName.Picture ="C:\image1.bmp"

But this does not work.

Thanks !
 
Your code will work assuming:
1) The name of the Image control is "imageName"

2) There actually is a valid Bitmap file in your C:\ drive named
"image1.bmp"

Are you sure you are using the standard Image control, not one of the OLE
Frame controls?
What is the error that is being generated?

Finally, move your code to the PRINT event of the relevant section
containing the Image control.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thanks for responding...

Arghh, I had a typo... it works...

But why on PRINT and not on Format ?
 
The Format event can be called multiple times which may result in a lack of
resources/memory issue.

Additionally, you need to turn off the "Loading Image" dialog that appears
as each image is loaded into the control. Use the Registry based mod here:
http://www.mvps.org/access/api/api0038.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top