Working with images in forms...

R

Rudi Groenewald

Hi experts,

I have first tried embedding images into my sql server database, but after
realising the negative effects, I instead tried linking images. my scenario
for images is this. Images are stored on a shared server ( eg:
\\servername\images\image1.jpg ) My sql database will only have a link for
my image. eg: image field name = "image1" while the field contents will
only be text eg: \\servername\images\image1.jpg .


What I would like access to do is. When my user fills in the form and has
to insert his image, The user clicks on a browse button and selects his
image for the field, the access should copy this image to the shared server,
generate random file name (asuming there already could be an image with the
same filename, just to be safe) for this image, and in the end, only store
in the database the link to this image ( eg:
\\servername\images\image1.jpg ) even without my user knowng what happened.
and of course, then show this image when inserting it into the field.

Please help

Rudi
 
G

Guest

you would probably do better with an image control on your
form. i have an unbound form that loads pictures. i use

Me.PartPic.Picture = DLookup
("[filepath]", "Parttable", "[id] ='" & Me.txtID & "'")

where partpic is the name of the image contol
Picture is the property i am changing
filepath is where the table field that stores the filepath
of the image
parttable is the name of my part table
Id is the table record id of the part
Me.txtid is the text box on the form where i enter the id.

i use the above dlooup to load the image's file path into
the image control's picture property. the image's file path
(which you are calling a link) is stored in the table with
the part as part of the parts record. all the part images
are in a special directory on our public drive so that
everyone can get to it.
 

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