Private Sub Combo3_Click()
Dim Rs As ADODB.Recordset
Dim MySql As String
Dim Cus As ADODB.Connection
Set Cus = New ADODB.Connection
Cus.ConnectionString
= "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source= C:\Cyuan\Cy.mdb;Persist Security Info=False"
Cus.CursorLocation = adUseClient
Cus.Open
Set Rs = New ADODB.Recordset
Select Case Combo3.Text
Case "ALL"
MySql = "select 簡稱 from 客戶基本資料 order by 客戶編號 "
Case "01"
MySql = "select 簡稱 from 客戶基本資料 where 客戶編號 like '01%' order by 客戶編號 "
Case "02"
MySql = "select 簡稱 from 客戶基本資料 where 客戶編號 like '02%' order by 客戶編號 "
Case "03"
MySql = "select 簡稱 from 客戶基本資料 where 客戶編號 like '03%' order by 客戶編號 "
Case "04"
MySql = "select 簡稱 from 客戶基本資料 where 客戶編號 like '04%' order by 客戶編號 "
End Select
Set Rs = Cus.Execute(MySql, , adCmdText)
Do Until Rs.EOF
Combo4.AddItem Rs!簡稱
Rs.MoveNext
Loop
Rs.Close
Set Cus = Nothing
End Sub
-----------------------------------------------------------
這個程式有一個問題
例如我在combo3先選01
combo4就會跑出以01開頭的所有資料
可是當我再選擇02時
combo4的list卻沒辦法更新
這要如何解決呢??