Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Aware Usercontrol not updateble

Status
Not open for further replies.

mjohnson289

IS-IT--Management
Oct 5, 2001
8
US
I'm trying to create a simple DataAware Usercontrol. I throw a textbox on the usercontrol and link all the properties to it with the wizard. I've set the .Text property procedure attributes to be Databound on the DataField property. And it all seems to work when I bind it to and ADO datacontrol the data from the recordset displays in the new control as it should. However, the data is not updatable. I change the data in the control and the data is not written back to the recordset. I've bound a standard text control to the same datacontrol at the same time and that one updates as expected. What am I missing? Is there something I still need to do to get the data from the control back to the recordset?
 

You probably have theses two items (created by the wizard):

Public Property Get MyProperty() As String
MyProperty = txtBox.Text
End Property

Public Property Let MyProperty(NewValue As String)
If CanPropertyChange("MyProperty")
txtBox.Text = NewValue
PropertyChanged "MyProperty"
End If
End Property


You need to make sure you update the property when the value of the textbox changes.


Private Sub txtBox_Change()
PropertyChanged "MyProperty"
End Sub


This will update the data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top