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
 

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