Images in forms.

  • Thread starter Thread starter Jon Miles
  • Start date Start date
J

Jon Miles

Hi,
I am trying to import images into my access form, by creating a
browse for an image button. I would like imformation on code that
would enable me to do this. Then just by clicking on the button, the
window to select an image will come up, and from there i can import
that image into the image frame on the form.
Thank you for your help.
 
Hi,
I am trying to import images into my access form, by creating a
browse for an image button. I would like imformation on code that
would enable me to do this. Then just by clicking on the button, the
window to select an image will come up, and from there i can import
that image into the image frame on the form.
Thank you for your help.

You will need to supply a new path for the Image control.

You can obtain this by using the Windows File Open/Save dialog box.
Get the code here...
http://www.mvps.org/access/api/api0001.htm

Then just reset the images controls Picture property.

With a command button named NewImage and an image control named
imgTest then it would be like this...

Private Sub cmdNewImage_Click()
Dim strPath As String

strPath = ahtCommonFileOpenSave()
Me.imgTest.Picture = strPath
End Sub

The code for the File Open/Save dialog can be adjusted to the way that
you want. What I have posted above is just to illustrate the process.

- Jim
 
Back
Top