VB-ADO Recordset Bindings to Combo Boxes - TechRepublic
General discussion
January 11, 2001 at 06:58 AM
todd parker

VB-ADO Recordset Bindings to Combo Boxes

by todd parker . Updated 25 years, 5 months ago

Mind blower here….
VB 6, ADO 2.1 Referenced, Standard Data Combos.

I’ve got an ADO Class module I created that is opening a client side recordset. This recordset is then applied to some fields on a form. The usual stuff. I’ve added a few comboboxes, which require me to use a support recordset to list the possible user selections, and also binds back to the original recordset to know what the value should be selected for the current record. The usual stuff. (Just like an Access Combo Listfor those non-vb-people reading this). At any rate, after setting my ComboBox DataSource and other related properties (DataField etc..) the main Recordset (the DataSource RS) can no longer be navigated. The MoveNext, Prev, etc, no longer work, but the RS is still open. rs.state returns adstateopen. I think the DataCombo is messing with my original rs bookmark when bound. The weird part: While stepping through code, I can step back and rerun my rs initialization (through the class module) and the combo box will NOT mess up my rs. But the very next ComboBox I setup, will cause the same error. The error returned is “Operation Canceled”. Very descriptive, isn’t it…

A friend of mine suggested that I use another recordset (an rs.clone) which will work, however, that defeats the whole purpose of a Data Combo and it’s binding to the original recordset.

Does anyone have any suggestions, or would like to peruse some of my code?

Thanks in advance. Answers will be rated fairly.

Sincerely,
-Todd Parker

This discussion is locked

All Comments