Repost from 2005. Pictures in a form

  • Thread starter quinto via AccessMonster.com
  • Start date
Q

quinto via AccessMonster.com

I followed the direction below and I got stuck on the Form_Current event
procedure: ImageFrame.Picture=ImagePath. Where eaxaclty am I suppose to put
this? I cannot find a line Form_Current event procedure

Thank
Quinto


I just looked at Northwind for Access 2003 - I still do most of my Access
work in Access 2000.
Yes, the technique has changed; in older versions, it worked as I had
described in my previous post.
And while the older technique had the limitations I mentioned, it did have
the advantage of simplicity.

To follow (or reproduce) the technique used in the 2003 version of
Northwind, you'll have to use some VBA code.
The heart of the matter is on Line 37 of the Employee form's module; the
rest of that procedure is about dealing with cases where you don't have a
full path entered.

For simplicity, you can do this:
Make sure you have a Text field in your table, with a full path to an
existing picture file for each record. Let's call it ImagePath.
Now put an (unbound) Image Frame on your form, and name it ImageFrame.
Also put a bound textbox on your form; you can set both its name and its
ControlSource to "ImagePath".
Put this code in your Form_Current event procedure:
ImageFrame.Picture=ImagePath

You should now be able to move through the records in your form, and see a
picture for each one.
If you want to change the picture, edit the textbox, move to a different
record, then when you come back to this one, you should see the new picture.
Remember, this is just for starters, a simple way to start building this
technique.

Once you get this going, you may be able to study some more of the code and
figure out how to refine this model. If you have specific questions, do
post back. Remember to tell us:
What is it doing that you don't want?
What isn't it doing that you do want?
 
Q

quinto via AccessMonster.com

This is great it works like a charm except that if the picture field is blank
I get an error, can that be fixed?

Thanks a million

Quinto


Here's where you get to the form's On Current event:
http://www.btabdevelopment.com/main/QuickTutorials/Wheretoputcodeforevents/tabid/56/Default.aspx
I followed the direction below and I got stuck on the Form_Current event
procedure: ImageFrame.Picture=ImagePath. Where eaxaclty am I suppose to put
[quoted text clipped - 37 lines]
What is it doing that you don't want?
What isn't it doing that you do want?
 
Q

quinto via AccessMonster.com

B

boblarson

Printing is for REPORTS not forms.

as for when it is empty then you can use:

If Len([ImagePath] & "") > 0 Then
ImageFrame.Picture=ImagePath
Else
ImageFrame.Picture = ""
End If

--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


quinto via AccessMonster.com said:
Problems with printing, same picture prints out in all the forms but the view
is fine

Quinto
This is great it works like a charm except that if the picture field is blank
I get an error, can that be fixed?

Thanks a million

Quinto
[quoted text clipped - 3 lines]
What is it doing that you don't want?
What isn't it doing that you do want?
 

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