Browse Button

G

GR

Hi,
How can I code a button so it works as a Browse button
letting the user select an image file and put it in a ole
field?

Thx,
GR
 
P

Phil Carrero

GR:
Could do it with a command button too, but here is a way to do it
with a combo box and/or a list box:
Have a field with the hard disk location (folder) of the images. For
instance "L:\My Documents\Products" Another field with the
name of the images, like image1.jpg, image2.jpg and so on. (as well as an
index field like [ProdID]
Use an image field instead, not an Ole field, linked to an image to
display when there is no image selected, like "blank.jpg"

Then set up code on the AfterUpdate of both the combo and the list
box (both with the image field in the bound column property) to find the
image you want and change the picture of the image field to the one you want
to see.
The code would look something like:

Sub Combo0_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ProdID] = " & Me![Combo0]
Me.Bookmark = Me.RecordsetClone.Bookmark
Me!List2 = Me!Combo0
Me!photo.Picture = Me!ProdPath & "\" & Me!Path
End Sub

The same for the list box

Hope it helps,

Phil
Hi,
How can I code a button so it works as a Browse button
letting the user select an image file and put it in a ole
field?

Thx,
GR
 

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