G
Guest
Hi all
I am using access 2000 and sql server as backend. I want to populate a combo box with recordset values
my recordset contains 5 columns. some of the columns in the combobox will be hidden and 2 of them will be displayed in the combo. But the problem is that how to assign a recordset to combo box. usually we assign a querystring to rowsource but i didn't find any help or example which use recordsets in the rowsource.
Dim strSql As Strin
Dim conString As Strin
Dim con As ADODB.Connectio
Dim rst As ADODB.Recordse
strSql = "SELECT * FROM tblTeleList WHERE Active='Yes' ORDER BY tblTeleList.LastName
Set con = New ADODB.Connectio
conString = "Driver={SQL Server};Server=;DataBase=TelephoneListing;Uid=;Pwd=;
con.Properties("Prompt") = adPromptAlway
con.ConnectionString = conStrin
con.Ope
Set rst = New ADODB.Recordse
rst.Open strSql, con, adOpenForwardOnly, adLockReadOnly, adCmdTex
cmbLastName.RowSource = rst ----> i am not sure about this stmt
End Su
Any help will be appreciated.
Thanks
I am using access 2000 and sql server as backend. I want to populate a combo box with recordset values
my recordset contains 5 columns. some of the columns in the combobox will be hidden and 2 of them will be displayed in the combo. But the problem is that how to assign a recordset to combo box. usually we assign a querystring to rowsource but i didn't find any help or example which use recordsets in the rowsource.
Dim strSql As Strin
Dim conString As Strin
Dim con As ADODB.Connectio
Dim rst As ADODB.Recordse
strSql = "SELECT * FROM tblTeleList WHERE Active='Yes' ORDER BY tblTeleList.LastName
Set con = New ADODB.Connectio
conString = "Driver={SQL Server};Server=;DataBase=TelephoneListing;Uid=;Pwd=;
con.Properties("Prompt") = adPromptAlway
con.ConnectionString = conStrin
con.Ope
Set rst = New ADODB.Recordse
rst.Open strSql, con, adOpenForwardOnly, adLockReadOnly, adCmdTex
cmbLastName.RowSource = rst ----> i am not sure about this stmt
End Su
Any help will be appreciated.
Thanks