Private Sub Check1_Click()
If Combo1.Enabled = True Then
Combo1.Enabled = False
Combo1.Text = ""
Combo1.Clear
List1.Visible = False
Else
Combo1.Enabled = True
sql = "select * from fj "
Set qsglczdb = sushe.Execute(sql)
Do While Not qsglczdb.EOF
On Error Resume Next
Combo1.AddItem qsglczdb.Fields("楼号")
qsglczdb.MoveNext
Loop
End If
End SubPrivate Sub Form_Load() For g = 0 To Combo1.ListCount - 1 Step 1
List1.AddItem Combo1.List(g), g
Next
List1.Visible = FalseEnd SubPrivate Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.ListIndex = List1.ListIndex
List1.Visible = False
End If
End SubPrivate Sub Combo1_Change()
start = Combo1.SelStart
sString = Left(Combo1.Text, start)
For g = 0 To Combo1.ListCount - 1 Step 1
Dim sitem As String
sitem = Combo1.List(g)
sitem = Left(sitem, start)
If sitem = sString Then
List1.ListIndex = g
List1.Visible = True
Exit For
End If
Next提示错误, List1.ListIndex = g 3380 无效属性值
If Combo1.Enabled = True Then
Combo1.Enabled = False
Combo1.Text = ""
Combo1.Clear
List1.Visible = False
Else
Combo1.Enabled = True
sql = "select * from fj "
Set qsglczdb = sushe.Execute(sql)
Do While Not qsglczdb.EOF
On Error Resume Next
Combo1.AddItem qsglczdb.Fields("楼号")
qsglczdb.MoveNext
Loop
End If
End SubPrivate Sub Form_Load() For g = 0 To Combo1.ListCount - 1 Step 1
List1.AddItem Combo1.List(g), g
Next
List1.Visible = FalseEnd SubPrivate Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.ListIndex = List1.ListIndex
List1.Visible = False
End If
End SubPrivate Sub Combo1_Change()
start = Combo1.SelStart
sString = Left(Combo1.Text, start)
For g = 0 To Combo1.ListCount - 1 Step 1
Dim sitem As String
sitem = Combo1.List(g)
sitem = Left(sitem, start)
If sitem = sString Then
List1.ListIndex = g
List1.Visible = True
Exit For
End If
Next提示错误, List1.ListIndex = g 3380 无效属性值
' list1.SetFocus
' list1.ListIndex = lngIndex
If Combo1.Enabled = True Then
Combo1.Enabled = False
Combo1.Text = ""
Combo1.Clear
List1.Visible = False
Else
Combo1.Enabled = True
sql = "select * from fj "
Set qsglczdb = sushe.Execute(sql)
Do While Not qsglczdb.EOF
On Error Resume Next
Combo1.AddItem qsglczdb.Fields("楼号")
List1.AddItem qsglczdb.Fields("楼号") '同步增加
qsglczdb.MoveNext
Loop
End If
End Sub
List1.ListIndex = g
List1.Visible = True
Exit For
End If 改为:If strcomp(sitem ,sString)=0 Then
List1.Selected(g)=True
List1.Visible = True
Exit For
End If
將數據集 qsglczdb 新增一行, 加入 Combo1.text的數據
將新數據集更新賦給Combo1.datasource