Linking Images in a form

C

Carol Geddes

Using Access 2000
I am trying to link jpeg images to a Bound OLE Control
First I thought I would just try to link one image to the control no matter
which record I go to. Then when I get that to work then I want to have it
programmatically use the appropriate file. The picture file names correspond
to the unique ID of the records.

In the source doc property I placed the path to the file :
C:\AURORA\PICTURE\2001642.000
In the Open event of the form I placed: (This was sort of modified from the
help files.)
The program that stores the pictures saves them with .000 extension but they
are jpegs.

Private Sub Form_Open(Cancel As Integer)

' OLEBound0.Class = "Excel.Sheet" ' Set class name.
' Specify type of object.
OLEBound0.OLETypeAllowed = acOLELinked
' Specify source file.
OLEBound0.SourceDoc = "C:\AURORA\PICTURE\2001642.000"

' Create linked object.
OLEBound0.Action = acOLECreateLink
End Sub

I get a runtime error. 2753. A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control.
I am finding the help files on Microsoft site not very useful. I can't
figure out where to look.
Thanks,
Carol
 
S

ScottE

I might be misunderstanding your question, but I do not
think you need to use a bound OLE control. Why not use an
image, leave the picture property blank and set the
picture type to linked. In code (form_open), set the path
to the picture like:

picFile = "C:\AURORA\PICTURE\2001642.000" {or whatever}
Me!Image1.Picture = picFile

If you want event functionality, images can handle most
mouse events. If you want more, place a
button "underneath" the image.

Hope this helps!

- Scott
 
C

Carol Geddes

Never mind about this. I was too hasty on posting.
I now just used an image control and got it to work.on the form Current
Event.
The only problem I am having now is that the picture files have the
extension .000 even though they are jpegs. I have manually changed a few to
..jpg and I can get it to work.
If anyone knows how to make the image control accept the pictures as jpeg
even with the .000 extension. please let me know.
Carol Geddes
 
C

Carol Geddes

Thank you scott,

I haven't worked with Access for a few years and I feel very fuzzy with it.
I did decide to use an image control instead as I read further in my book.
Thanks for your help.
Carol
 

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