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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataCombo problem

Status
Not open for further replies.

PTracey

Programmer
Apr 15, 2003
2
0
0
AU
Hi, I am trying to code the fill of a datacombo droplist using vb6.
It basically executes an sql statement, creates the recordset with the data. I want to list the field 'person' in the datacombo, but have the personID field in some way attached to each persons name that is displayed. In other words, all the user will see is the name of the person they are selecting, but the program will use the personID of the selection. Is there some way to create hidden columns or something in order to hold the personID??

Open to suggestions??

Thanks.
 
Use the ListField and RowSource properties for the data which is to be shown, and the DataField and DataSource to the field to be affected.

So, if you wanted to show a copmpany's name in the combo, but bind the selection to the company ID field in an Orders table, set the ListField to the company Name field, the RowSource to the Company table, the DataField to the CompanyID field and the DataSource to the Orders table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top