ActiveX Control Saving to OLE Object

G

Guest

Dear all,

I posted this question to the ActiveX Control newsgroup a few of hours ago
but I don’t see it there so I’m trying you guys. Sorry if it does sometime
emerge on the ActiveX Control group.

I have an entry form linked to a table which has an OLE Object field type
called Structure for chemical structures. I have an ActiveX control (CS
ChemDraw Control 7.0) which I have placed on the form that works perfectly
well to create a structure but I don’t know how to save it in the Structure
field. If I try something like

Me.Structure = Me.ChemDrawCtl2.Value

I receive an error message that the setting I entered isn’t valid for this
property or the method isn’t supported. Any ideas are appreciated.

Cheers,

Alasdair
 
G

Guest

Alasdair said:
Dear all,

I posted this question to the ActiveX Control newsgroup a few of hours ago
but I don’t see it there so I’m trying you guys. Sorry if it does sometime
emerge on the ActiveX Control group.

I have an entry form linked to a table which has an OLE Object field type
called Structure for chemical structures. I have an ActiveX control (CS
ChemDraw Control 7.0) which I have placed on the form that works perfectly
well to create a structure but I don’t know how to save it in the Structure
field. If I try something like

Me.Structure = Me.ChemDrawCtl2.Value

I receive an error message that the setting I entered isn’t valid for this
property or the method isn’t supported. Any ideas are appreciated.

Cheers,

Alasdair

I'm part of the way to answering my own question but I'd still appreciate
some help. I think before I can save anything to the OLE Object field I need
to use the Insert menu to specify which type of OLE Object it is. So
something like

DoCmd.DoMenuItem(acForm, acInsertMenu, acObject)

But that doesn't work since there doesn't seem to be an acInsertMenu option.
Advice is still appreciated.

Cheers,

Alasdair
 
R

Ron Weiner

If the object is already in the clipboard then:
oleControl.SetFocus
oleControl.Action = acOLEPaste

If the object is in a file on the disk then
oleControl.OLETypeAllowed = acOLEEmbedded
oleControl.SourceDoc = "c:\temp.bmp"
oleControl.Action = acOLECreateEmbed
 

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