How do I display data from the Access ControlSource
in my VB Custom Control?
I've made VB ActiveX Controls (.ocx), and put them
on my Access forms before.
Now, I want to be able to set the control's
ControlSource property, so my control can display
'bound' data (like when you type "=FirstName" in a
textbox on a form).
The reason is to change the background color of
records in a continous form. Ex: in a list of
transactions, make any negative transactions have a
red background and any positive transactions have a
So I make a new "ActiveX Control" vb project, throw a
textbox in it, and add this code:
Private Sub UserControl_OLESetData
(Data As DataObject, DataFormat As Integer)
MsgBox "set data"
Then, I added the control to my Access form like normal,
and realized it didn't have a ControlSource property.
One I get the ControlSource, I know how to use built-in
functions in Access to feed my control a RGB number.
I also know how to respond to the RGB number- how to
color the bg.
This is my first question- tell me if I'm doing it wrong