Combo box bound to ADO Recordset object? 
Author Message
 Combo box bound to ADO Recordset object?

VB6 question:

There must be something blindingly obvious that I'm missing.

Let's say I have a disconnected ADO Recordset consisting of two character
fields, WidgetCode and WidgetDescription.  I wish to populate a combo box
with WidgetDescriptions.  Once the selection has been made, I want my
program to be able to have immediate access to the associated WidgetCode.

It does not appear that I can use a DBCombo or DataCombo object, since both
must be bound to a data control (I don't want to do this, since my data
interface is located elsewhere).

It also does not appear that I can use a simple ComboBox, since I don't see
any way to tell the object which WidgetCode goes with which
WidgetDescription.

So.... what am I missing?

-----
Tim Thornton
College Station, Texas, USA



Sat, 10 Apr 2004 06:12:50 GMT  
 Combo box bound to ADO Recordset object?

Quote:
> It also does not appear that I can use a simple ComboBox, since I don't
see
> any way to tell the object which WidgetCode goes with which
> WidgetDescription.

Why not? Each WidgetCode has a WidgetDescription. Whatever the selection is,
do a query to the database that matches the WidgetCode that was selected in
the ComboBox.

Hope this helps.

HP Lorenzana



Sat, 10 Apr 2004 23:38:34 GMT  
 Combo box bound to ADO Recordset object?

Quote:
> > It also does not appear that I can use a simple ComboBox, since I don't
> see
> > any way to tell the object which WidgetCode goes with which
> > WidgetDescription.

> Why not? Each WidgetCode has a WidgetDescription. Whatever the selection
is,
> do a query to the database that matches the WidgetCode that was selected
in
> the ComboBox.

Yes, but I was looking for a way to do this without hitting the database
again.  It would have been nice if the combo box allowed us to store a
non-numeric key with each list item.  The ItemData array works great for
numeric keys, but that's not what I need.

It looks like the best solution is to retain the (disconnected) recordset I
used to populate the combo box, and then use recordset.Seek() to retrieve
the WidgetCode.

-----
Tim Thornton
College Station, Texas, USA



Sun, 11 Apr 2004 00:55:04 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Combo box bound to ADO recordset object?

2. HELP! ADO bound list box and combo box

3. Combo Box like Data Bound Combo Box?

4. ADO Combo Boxes Displaying Bound Data?

5. ado base and combo box, bounded?

6. Data Bound Combo Box within a Data Bound Grid

7. Problem binding a text box to a ADO data object

8. Bound combo box and text box

9. Data bound Combos or Not Data Bound Combos

10. Bind an ado recordset directly to an ado data control (adodc)

11. Load combo boxes: one recordset or multiple recordsets?

12. binding data combo to recordset

 

 
Powered by phpBB® Forum Software