Links to images not working in Access Project

G

Guest

I have an Access2003 database (.mdb) form working that provides detailed
information on parts including links to JPEG photos in another directory.
The Image Object is ImageFrame1 and the column heading in my database is
Pic1. Pic 1 contains folder/file names for my photos. The VBA code in my
form used to call my photo's is as follows:

*********
Option Compare Database
Option Explicit

Private Sub Form_AfterUpdate()
CallDisplayImage
EndSub

Private Sub Form_Current()
CallDisplayImage
End Sub

Private Sub txtImageName_AfterUpdate()
CallDisplayImage
End Sub

Private Sub CallDisplayImage()
Me!txtImageNote = DisplayImage(Me!ImageFrame1, Me!Pic1)
Me!txtImageNote = DisplayImage(Me!ImageFrame2, Me!Pic2)
End Sub
***********

When I converted the database to an Access Project, the above code produces
a VBA error message 'Sub or Function not defined' when I open the form. The
VBA text 'DisplayImage' is highlighted in the VBA code screen.

Is the method to call for photo's in ADP (Project) different from MDB?

Your kind assistance would be most appreciated.
 
T

TC

There's no build-in Access method called DisplayImage as far as I know.

Are you sure it isn't a procedure or function in a standard module in
your mdb file?

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

I copied the above code straight from the _AfterUpdate and _Current Event
Procedures. As stated, it works fine as an MDB but gives me an error ['sub
or function not defined' with DisplayImage highlighted] after converting the
database to a project.
 
T

TC

Sorry, I can only repeat what I said before:

There's no build-in Access method called DisplayImage as far as I know.

Are you sure it isn't a procedure or function in a standard module in
your mdb file?

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

I understand. Maybe a better way to restate this would be to start from
scratch and ask: How would I create an Image control on an Access Project
form and link it to a field in a table where the field contains paths to JPEG
files?
 
T

TC

Sorry, but I don't know enough about ADPs to answer that. I'm not being
much help at present!

As for the DisplayImage thing, open any code module in your database,
select Edit:Find, type "displayimage(" without the quotes, and select
the option to search the whole project (which just means, /all/ the
modules in that database). Maybe that will find a Sub or Function
definition of DisplayImage. If it did, maybe you could copy that code
to your ADP (not sure how), or, take the statements out of it & use
those in your ADP.

Sorry I can't help much further. I was really just trying to help you
with the DisplayImage not defined thing. If no-one else can help in
this thread, maybe start another thread with a more-focussed subject
line, eg. "How to display images from ADP?", or somesuch.

Cheers,
TC (MVP Access)
http://tc2.atspace.com
 
T

TC

Oops, you already say "Access Project" in the subject line. I missed
that cos it scrolled off my screen.

TC
 

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