This is my first project using ADO and I am having difficultly populating a combo box. I can populate 1 column, but i want to populate 2 columns. The first column would be the id number. the second column would be the name of the service. Here is the code I am currently using
Once I get both columns populated I can setup the combo box to show the service, but capture the id number.
Thank you for your assistance
Jason Meckley
Database Analyst
WITF
Code:
'Populate Service Combo Box
Dim cboServiceSql As String
Dim I As Integer
Dim rsCboService As ADODB.Recordset
cboServiceSql = "exec sp_services_s"
Set rsCboService = New ADODB.Recordset
rsCboService.Open cboServiceSql, cnnCWO(User, Pwd)
cboService.Object.Clear
For I = 1 To (rsCboService.RecordCount)
cboService.Object.AddItem rsCboService.Fields("Service")
rsCboService.MoveNext
Next I
rsCboService.Close
Set rsCboService = Nothing
Thank you for your assistance
Jason Meckley
Database Analyst
WITF