File Open Common Dialog

G

GR

Hi,
I have a form called Devices which holds the description
of different devices including a pic of the device.
I want to add a button which lets the user browse for the
image in his current folder so the pic can be changed or
added if there's no image associated to the current device.

I'am trying with the following code

Private Sub cmdOpen_Click()
Dim dlgCommon As CommonDialog
Dim olePicture As ObjectFrame

dlgCommon.ShowOpen
If Len(dlgCommon.FileName) Then
olePicture.SourceDoc = dlgCommon.FileName
olePicture.Action = acOLECreateLink
End If
End Sub

But the following error message appears:
"Object Variable or With block variable not set"

All the necessary references are created.. I think is an
instantiation mistake but how to solve it?

thx
 
Top