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 05:47:58 GMT  
 Combo box bound to ADO recordset object?
Tim

You might find that the ItemData property is what you are missing.  In a
simple combo box, use the Text property for your WidgetDescription and use
the ItemData property for your WidgetCode.

Rgs
Martin



Quote:
> 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 08:52:48 GMT  
 Combo box bound to ADO recordset object?
If your WidgetCode is numeric you can use the combo's ItemData array.
Otherwise, if you already have them in a disconnected recordset, load
the descriptions into the combo and use the recordset's Filter or Find
on the the Description column to get the Code.


Sat, 10 Apr 2004 16:57:08 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