Image & PictureBox VB vs. VBA

E

Ed Landau

In VB6.0, I can put an image on a form and assign it's .picture property at
run-time.
In VBA (within MS Access), when I put down an image control on a form, it
asks me for the source to the image (at design-time). Why?

Why can't I find PictureBox in VBA within MS Access?

And most importantly...why can't I put either in a Report within MS Access?
What I really want is to be able to display pictures in an MS Access report
(pictures which are .bmp files).


Why Why Why.... so many questions :)

Thanks in advance for any insights.

-Ed

Cross Posting to:
comp.databases.ms-access; microsoft.public.office.developer.vba;
microsoft.public.vb
 
S

Stephen Lebans

Answers inline...

--

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


Ed Landau said:
In VB6.0, I can put an image on a form and assign it's .picture property at
run-time.
In VBA (within MS Access), when I put down an image control on a form, it
asks me for the source to the image (at design-time). Why?

That's just the way the control's interface was designed. You can still
set the control's Picture property at runtime for both forms and
reports.
Why can't I find PictureBox in VBA within MS Access?

It simply doesn't exist as most Access controls are lightweight in
nature(no exposed hWnd). Control's are lightweight due to
resource/complexity issues that presenting forms in Continuous/Datasheet
view would present. I have produced a class wrapper for the standard
Acces Image control to allow it to emulate the VB PictureBox control
here:
http://www.lebans.com/imageclass.htm
And most importantly...why can't I put either in a Report within MS Access?
What I really want is to be able to display pictures in an MS Access report
(pictures which are .bmp files).

Not sure why you are having trouble here. For Forms you simply set the
Image control's Picture property in the Current event. For reports set
the control's Picture property in either the section's Format or Print
event.
Why Why Why.... so many questions :)
Because you believe that the VBA environment, in particular the Access
VBA environment should be identical to that of VB. They are two very
different development platforms. Use the Object browser to examine the
Acess objects exposed methods and properties to help you understand the
difference between the Access VBA and VB development platforms.
 
E

Ed Landau

Thanks Setphen.
If I put an image in MSAcecss Report. It does not have a .picture or .image
property. I see that property in the Properties window at design time, but
if I set a breakoint at the pageHeaderSection_format, in the immediate
window, the autosense does not expose a "picture" property ??

I've tried other controls and it complains that it cannot set those
properties after report has been started. I'll have a look at your
control.

Thanks again for your help... I'm can see the light at the end of the tunnel
:)

-Ed
 
S

Stephen Lebans

If you are using the standard Image control on your Report then there is
a Picture property. Intellisense is showing you the exposed props and
methods for a generic control not 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.
 
E

Ed Landau

INTERESTING !!!!!!!
"Intellisense is showing you the exposed props and methods for a generic
control not the Image control". I tried it and it worked. Thanks a
bunch ! I always thought that if intellisense was there at all, it was
correct. Now I know not to trust what I see :)

-Ed
 

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