ComboBox and Database--PLEASE HELP CANT CONTINUE
I have a combo box populated using .additem with three fields from a recordset.
When the user selects an item how do I determine what record they are on? Can I bind the Combo Box to work like the ADO Control where you can navigate through a recordset by using the combo box?
I have tried using .itemdata and other properties with no luck.
There must be a standard way of doing this because combo boxes are used in almost every database.
----------------
Would it be easier to use the DataEnviroment? I havent found much documentation on it. Can it do everything you can do using code to make the connections and generate the recordsets?
Thank you,
Coopetj
Re: ComboBox and Database--PLEASE HELP CANT CONTINUE
Quote:
Originally posted by coopetj
I have a combo box populated using .additem with three fields from a recordset.
When the user selects an item how do I determine what record they are on? Can I bind the Combo Box to work like the ADO Control where you can navigate through a recordset by using the combo box?
I have tried using .itemdata and other properties with no luck.
There must be a standard way of doing this because combo boxes are used in almost every database.
----------------
Would it be easier to use the DataEnviroment? I havent found much documentation on it. Can it do everything you can do using code to make the connections and generate the recordsets?
Thank you,
Coopetj
Well, when you do an additem to a combobox, you have an index, if you have a unique numeric field in your database, you can set the index to that, and recall it that way. I have a much more complicated way of doing it, but it requires that you have my classes, and know how to use them.
Rick
I have a combo box populated using .additem with three fields from a recordset. ...
try this code:
With DataCombo
Set .DataSource = rstMyTable
.BoundColumn = "MyTable.Field"
Set .RowSource = rstMyTable
.ListField = "MyTable.Field"
End With
:p
Re: ComboBox and Database--PLEASE HELP CANT CONTINUE
Quote:
Originally posted by coopetj
[B]I have a combo box populated using .additem with three fields from a recordset.
When the user selects an item how do I determine what record they are on? Can I bind the Combo Box to work like the ADO Control where you can navigate through a recordset by using the combo box?
I have tried using .itemdata and other properties with no luck.
There must be a standard way of doing this because combo boxes are used in almost every database.
use this... cmb.list(cmb.listindex)
this will return your current selection...