How to programatically change the Picture property at runtime

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 !
 
S

Stephen Lebans

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.
 
R

Rob

Thanks for responding...

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

But why on PRINT and not on Format ?
 
S

Stephen Lebans

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.
 

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