Creating an ActiveX control for Access

J

Jon Lewis

Has anyone any experience of creating an ActiveX control with VB6 for use on
a Microsoft Access form? How would one go about allowing the control to be
'Bound'?

I'd like to drop the control onto a bound Access form and choose a Control
Source for it in the same way as a standard Access control.

I'm thinking that all the properties of the Access form should be exposed
through the Ambient property of the Control so I could grab the form's
Record Source and populate a combo for a "ControlSource" property of the
control in its Property Page with all the Fields in the Record Source and
hence set the property.

I could then set the control's "Value" property by reading the Field's value
in the Form's Current event but how could I write a changed value back to
the Form's RecordSource? Would a seperate DAO connection work without
conflict? Any help or examples greatly appreciated.

TIA
 
K

Ken Halter

Jon Lewis said:
Has anyone any experience of creating an ActiveX control with VB6 for use
on a Microsoft Access form? How would one go about allowing the control
to be 'Bound'?

I'd like to drop the control onto a bound Access form and choose a Control
Source for it in the same way as a standard Access control.

I'm thinking that all the properties of the Access form should be exposed
through the Ambient property of the Control so I could grab the form's
Record Source and populate a combo for a "ControlSource" property of the
control in its Property Page with all the Fields in the Record Source and
hence set the property.

I could then set the control's "Value" property by reading the Field's
value in the Form's Current event but how could I write a changed value
back to the Form's RecordSource? Would a seperate DAO connection work
without conflict? Any help or examples greatly appreciated.

TIA

I've never tried creating a control for use in Office but here's a few
links... the first is "just the bones", the second contains links to quite a
few samples.

Binding a Control to a Data Source
http://msdn.microsoft.com/library/d...ml/vbconbindingyourolecontroltodatasource.asp

Creating Data Sources
http://msdn.microsoft.com/library/d...-us/vbcon98/html/vbconbuildingdatasources.asp
 
J

Jon Lewis

Thanks Stephen I'll take a look.

Stephen Lebans said:
There are several examples, including VB source code, of bound ActiveX
controls on my site.

It has been several years but if I remember correctly, there are two or
three issues that must be taken into account when creating the VB ActiveX
control. These issues have to do with the idiosyncrasies of the Access
Host container. A GoogleGroups search should yield the relevant threads.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
J

Jon Lewis

Thanks Stephen, I'll take a look.


Stephen Lebans said:
There are several examples, including VB source code, of bound ActiveX
controls on my site.

It has been several years but if I remember correctly, there are two or
three issues that must be taken into account when creating the VB ActiveX
control. These issues have to do with the idiosyncrasies of the Access
Host container. A GoogleGroups search should yield the relevant threads.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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