Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get ms-access to display images from external files

I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-pasted into the field by the users).

For various reasons, I would like to do is store the original .jpgs in a folder on the network drive, and reference them from the application portion. I have considered moving into MS-SQL's image data type (and its replacement varbinary), but I think my user population will more easily grasp the concept of the network folder.

How can I get MS Access to display the contents of a .jpg?

like image 798
BIBD Avatar asked Sep 02 '08 17:09

BIBD


1 Answers

Another option is to put an image control on your form. There is a property of that control (Picture) that is simply the path to the image. Here is a short example in VBA of how you might use it.

txtPhoto would be a text box bound to the database field with the path to the image imgPicture is the image control The example is a click event for a button that would advance to the next record.

Private Sub cmdNextClick()
    DoCmd.GoToRecord , , acNext
    txtPhoto.SetFocus
    imgPicture.Picture = txtPhoto.Text
    Exit Sub
End Sub
like image 172
WaterBoy Avatar answered Nov 15 '22 07:11

WaterBoy