Databinding my new activex control.

I don't think I understand the process of making my activex control I am creating a databound control.

Does anyone have a SIMPLE example (source code) of any activex control that is databound.
gwizAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JagarCommented:
 Open up your ActiveX control project like normal.  Then click the Tools menu.  Then click Procedure Attributes.  In the top drop box called name, select the property that you want databound, i.e. Text property of a Textbox.
  Then click the Advanced button.  Then check the checkbox labeled Property is data bound.  Then you can check of This property binds to DataField and possible Update immediate.
0
gwizAuthor Commented:
I tried that and it didn't work. Here is my code... txtDataValue is a textbox...

--------------------

Public Property Get DataValue() As Variant
    '
    ' Return the data bound value if one exists
    '
    DataValue = txtDataValue
End Property
Public Property Let DataValue(ByVal NewValue As Variant)
    '
    txtDataValue = DataValue
    PropertyChanged "DataValue"
End Property

--------------------

I run the test form that has my ActiveX control on it. I also have a DAO data control on the form. If I use the data control to move through the data, the textbox updates to display the data that is in database as it should. But if I make a change to the text box, the change never gets back to the database.

Did I miss something some place?
0
gwizAuthor Commented:
Ok, I think I found something... Can anyone help....


If I take all code out of the UserControl_Initialize then the data binding works. I can read and write to the bound data field. But if I do anything in the _Initialize routine (such as UserControl.Height = 150) then I can read from the data bound field, but I can't write back to it.

What is this all about?

I am running VB6.0 SP3...
0
JagarCommented:
Comment never heard of that limitation, but my answer was basically correct.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gwizAuthor Commented:
Yes it is mostly correct. Post another answer and I will accept it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.