Refreshing Unbound OLE objects SorceDoc (1 Viewer)

JACKSON

Registered User.
Local time
Today, 08:32
Joined
Dec 22, 2003
Messages
79
hI

I am trying to refresh an UnboundOLE objects Source Doc property through code. Basically, I have a dropdown on my form that contains a list of images (c:\image.bmp, c:\image2.bmp, etc..). I have added an unboundOLE object to my form that is linked to an image file with a Document Source property set to C:\image1.bmp. I am trying to have the image (OLEUnbound Object)update when a user selects a different image file from teh drop down. I have put some code on the update and change events of the drop-down combo box but it doesn't seem to do anything.

Dim StrSourceDoc As String

StrSourceDoc = me.combo1.value

Me.OLEUnbound32.SourceDoc = StrSourceDoc
Me.OLEUnbound32.Requery

This does not seem o do anything
aNY iDEAS ?
 

Sergeant

Someone's gotta do it
Local time
Today, 03:32
Joined
Jan 4, 2003
Messages
638
I have had the most luck using an "Image" control instead of Unbound OLE.
Place the image control on the form, selecting an image and then in the image control's properties: Clear out the 'picture' path; Change 'embedded' to 'linked'.

Now, in your combo box after update:
Me.Image0.Picture = Me.MyComboBox

No need to refresh anything.
 

JACKSON

Registered User.
Local time
Today, 08:32
Joined
Dec 22, 2003
Messages
79
Worked Great !
Thanks
 

Users who are viewing this thread

Top Bottom