Images in forms.

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.
 
J

Jim Allensworth

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
 

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