Most databound controls in VB Migration Partner library automatically update their data source when the input focus leaves the control (i.e. in their LostFocus event). However, in general controls don’t update their data source if their value is assigned programmatically.
To help you work around this behavioral difference, the VB6Form and VB6UserControl classes expose a custom UpdateDataSource method, which is meant to be called after a series of assignments to the bound property of a group of controls. The UpdateDataSource method receives an optional argument, i.e. the control whose data source must be updated; if you omit this argument, all the bound controls on the form or usercontrol’s surface are forced to update their data source.
It is convenient to add the call to UpdateDataSource method by means of an InsertStatement pragma:
Private Sub cmdSave_Click()
txtName.Text = strName
txtAddress.Text = strAddress
txtCity.Text = strCity
The VB6Data, VB6RemoteData, and VB6ADODC controls also expose the UpdateDataSource method, which iterates over all the controls that are bound to that specific data control. This method is more convenient if the parent form or usercontrol contains multiple data controls.