BUG: Recordset EditMode is Not Set Properly When Data is Modified Through Bound Controls (251225)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q251225 SYMPTOMS
When using some controls bound to an ADO Recordset object, the EditMode is not set properly when you modify the data through the bound controls. These controls include the Microsoft DataCombo control.
With other controls bound to an ADO Recordset object, the EditMode is set properly when data is changed through the bound controls. These controls include the TextBox.
The expected behavior is that the EditMode is set properly for each type of bound control.
CAUSE
The affected controls do not notify the Binding Collection that they are dirty.
RESOLUTION
There are several possible workarounds for this problem:
- Bind the control to an ADO DataControl or to a DataEnvironment instead of an ADO Recordset object so the that the EditMode is set properly.
- Check in the LostFocus event of the control to see if the control's value has changed. If it has, copy the change to the underlying recordset.
- Execute the recordset's Move method with a value of 0 to immediately post the control's change. You could execute this method in the control's Change event, for example.
- Bind the control to a BindingCollection object. When using a BindingCollection object, the EditMode property is set properly.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
For additional information, please see the following topics in the Microsoft Visual Basic 6.0 Online Help index:
- DataCombo control
- BindingCollection object
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbComboBox kbCtrl kbDatabase kbDataBinding kbDSupport kbListBox KB251225 |
---|
|