link photo's to Autonumber in form of Access 2000

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a form to display info on model specific
information of an asset. I want to include a photo field
that will display a digital picture of that model of
equipment. I can save the pictures as any format, that is
not the issue.

Is there a way to have that photo field display the photo
relating to the Autonumber field, e.g.
D:\Access\Asset_25.bmp, where the "25" represents AssetID
25 in my Autonumber field.

What type of field do I use in the table and form (OLE ?).

Do you have any suggestions on how to do this or
alternative ideas.

Thanks very much,
Dave
 
I would link the photo as an ole object and use code to
find the photo as follows:

stLoc = ( the folder where you store your photos, ending
in '/' )


With Me!Photo
.OLETypeAllowed = acOLELinked ' or could be
embedded if you prefer
.Class = "jpegfile" ' or bitmap or whatever
.SourceDoc = stLoc & "Asset_" & me!
assetId ".jpg" 'or ".bmp"
.Action = acOLECreateLink
End With

You could attach this code to a specific command button or
it could run at some other point after the record is
saved. You should be aware that attaching multiple photos
causes your data to grow quite significantly so you may
want to detach the photo when the form is closed so that
the link it not permanent (then compact your data
regularly).
 
Back
Top