Setting SourceDoc in VB

J

Joel

Hello,
I have a unbound OLE object in my form and I would like to change the
SourceDoc path with VB but it will not change.

EX:
Private Sub Form_Current()
Me.AutocadDWG.SourceDoc = Me.tbAutoCadloc
me.refresh
End Sub

This works great with an image frame but I cant get it to work with an
Unbound Object.

Thanks
Joel
 
D

David Lloyd

Joel:

In order for the SourceDoc property change to be reflected in the form you
need to set the Action property of the unbound OLE object. The Enabled
property must be set to Yes and the Locked property must be set to No for
this to work properly. For example:

Private Sub Form_Current()
'Linked OLE object
Me.OLEUnbound15.SourceDoc = "H:\TestTarget.xls"
Me.OLEUnbound15.Action = acOLECreateLink

'Embedded OLE object
Me.OLEUnbound16.SourceDoc = "H:\TestTarget.xls"
Me.OLEUnbound16.Action = acOLECreateEmbed
End Sub

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hello,
I have a unbound OLE object in my form and I would like to change the
SourceDoc path with VB but it will not change.

EX:
Private Sub Form_Current()
Me.AutocadDWG.SourceDoc = Me.tbAutoCadloc
me.refresh
End Sub

This works great with an image frame but I cant get it to work with an
Unbound Object.

Thanks
Joel
 

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