View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default changing image control's picture path

Greetings all,
i am trying to set up a data base that has informaton
about inventory items. on the form i have an image control
which hopefully will display a picture of the item. the
pictures file path will be in the database but i can't
seem to get the test code to work. i keep getting a error
on the line:
Image1.picture = picpath
error: compiler error object required.
code so far:
Private Sub CommandButton1_Click()
Dim picpath As String
Dim rng As Range
Dim Image1 As Control
Dim Picture As Property
Set myrng = Range("A1")
Set picpath = "H:\" & myrng.Value
Application.EnableEvents = False

Image1.Picture = picpath

End Sub
thanks in advance to anyone who can show me what i am
doing wrong.