![]() |
DataList not fill
Help which is my err? thanks!
Private Sub TextBox1_Change() Dim Way As String Dim Cnn As ADODB.Connection Dim Rst As ADODB.Recordset Dim dlDataList As DataList Dim Fonts As String Load UserForm1 Way = ThisWorkbook.Path Fonts = TextBox1 Set Cnn = New ADODB.Connection With Cnn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "Data Source=" & Way & "\Travels.mdb" .Open End With Set Rst = New ADODB.Recordset Rst.Open "SELECT DISTINCT Travel.Tname FROM Travel WHERE Travel.Tname " & _ "LIKE '" & Fonts & "%' ORDER BY Travel.Tname", Cnn, , , adCmdText Set Adodc1.Recordset = Rst Set dlDataList = DataList1 Set dlDataList.RowSource = Adodc1 Rst.Close: Set Rst = Nothing Cnn.Close: Set Cnn = Nothing End Sub |
All times are GMT +1. The time now is 03:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com