Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box

Status
Not open for further replies.

toolsofministry

Programmer
Sep 11, 2002
24
US
Have a combo box tied to a data control which is tied to a query in an Access database. Query has 4 fields. How do you store the value of a field that is not the bound column to a variable using VB code.
 

Say you want the 2nd field called: myFieldName2

Then:
myVariable = DataControl1.Recordset("myFieldName2")

Or,
myVariable = DataControl1.Recordset(1)

(using the number 1 instead of 2 because the base is zero. So Recordset(0) is the first field, and Recordset(1) is the second field, etc.) [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
It appears that you are saying that the record selected in the combo box becomes the current record in the Data Control. Is that correct?
 
vb6novice: It the combo is truely and corretcly bound to the data control, then yes.... [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top