Images on a form

S

Steve A

Hi,
I have a form, which I type a file name in, without the suffix. I want to
then click on a button and make the related image for that file display on my
form. I'm sure this is possible from the help files I've read, but they
don't explain it in enough detail for me to get it to work.

I want a different picture to be displayed for each different record.

could anyone help me with how I should get around this problem.

Thanks very much

Steve A
 
A

Andi Mayer..

Hi,
I have a form, which I type a file name in, without the suffix. I want to
then click on a button and make the related image for that file display on my
form. I'm sure this is possible from the help files I've read, but they
don't explain it in enough detail for me to get it to work.

I want a different picture to be displayed for each different record.

could anyone help me with how I should get around this problem.

Thanks very much

Steve A

put a picture-control on the form

in the on_click event of the button

me.picturecontrol.picture="C:\tmp\picture.jpg"

give picturcontrol the name of your picturcontrol and use the file you
want to show
 
L

Larry Linson

I have a form, which I type a file
name in, without the suffix. I want to
then click on a button and make the
related image for that file display on my
form.

The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
 
S

Steve A

Thats great, I've actually set up a query that will show the image when a
button is clicked, but how do I then make this show the image only visible
when the related record is open?

At the moment my query is...

SELECT Table1.name, ("C:\Documents and Settings\Steve\Desktop\" &
Table1.Name & ".jpg") AS Path
FROM Table1;

then I run

Private Sub Command3_Click()
Image2.Picture = Path.Value
End Sub

This shows the image perfectly, but then when I go to the next record the
same image shows and the record is refering to a different picture.

Thanks
 
A

Andi Mayer..

Thats great, I've actually set up a query that will show the image when a
button is clicked, but how do I then make this show the image only visible
when the related record is open?

At the moment my query is...

SELECT Table1.name, ("C:\Documents and Settings\Steve\Desktop\" &
Table1.Name & ".jpg") AS Path
FROM Table1;

then I run

Private Sub Command3_Click()
Image2.Picture = Path.Value
End Sub

This shows the image perfectly, but then when I go to the next record the
same image shows and the record is refering to a different picture.
if Image.Picture<>Path.Value then image.picture=""
 
Top