Log in

View Full Version : How to get a package object to open immediately w/o clicking on it?


pamuka
Apr 8, 2009, 08:58 AM
Hi
I designed a database in Access 2007 and created a form.
The field that concerns me contains a (.jpg) package object which opens in Paint.
I would like this field to open immediately when I go to this record without clicking in the field. Is there a macro or anything else that would allow this to happen?
Thanks:)

ScottGem
Apr 8, 2009, 11:12 AM
First I do NOT recommend using OLE Objects as they can cause bloating. Instead I recommend that you store the path to the image file in a text field. You can then use an unbound Image control and set the Picture property of that control to the path to display the image.

But if you prefer opening the image in whatever is the default image editor/viewer, or a specific image editor/viewer then its simple. In the On Current event of your form use code like:

Application.FollowHyperlink Me.txtImagepath

Where txtImagepath is the name of the control bound to the text field. If you prefer to specify the Image editor, then you would first name the image editor exe and then the patch top the image. This may vary depending on the image editor.