Using OLE to display a JPG image

R

Randy Hartwick

I was following instructions from a previous post about adding a JPG image.
I was able to complete everything, however once I opened the form I received
the error message "2220...can't open the file..." The previous post
instructions were:

First of all, store your pictures in a separate folder named
InventoryItemsPics.

Add a field named MyPath to your table. Include this field in the
recorsource of your form. Add a textbox named MyPicture to your form. Set
the ControlSource as MyPath. When you enter a new inventory item to your
database you will enter the path to the picture of the item in this textbox.
Comething like:
C:\InventoryItemsPics\MyInventoryItem,jpg
Add an image control named PhotoField to your form. Open properties and
under the Format tab set the Size Mode property to Stretched. Put the
following code in the AfterUpdate event of MyPicture textbox:
Me!Photofield.Picture = Me!MyPicture
Put the following code in the Current event of your form:
Me!Photofield.Picture = Me!MyPicture

That should do it!

In the table field "MyPath" I had entered
"\\Administrative\IDWorks\Database\Photos\0000.jpg". The file 0000.jpg does
exist exactally as defined in the network path as typed into the field.

What am I missing?
 
N

Neil

The only thing that spring to mind is a mis-typing of the filenname somwehere.

If you look at www.nwarwick.co.uk and check out the Access pages, there is a
tutorial on handling pictures, which includes a routine that allows you to
use the standard windows selector box to get the filename.

HTH

Neil
 
S

Srowe

I have used the tutorial from the website below for adding pictures. I cut
and copied as directed but when I add a picture to one record it changes the
previous record to the same picture. Essentially I have the same picture for
every record I have.

Is there something that I am missing. I copied and pasted the code into my
database exactly.

Can anyone help?

Thanks in advance.
 

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