ruanjy 发表于:2011-11-02 16:09:40
组合框 模糊查询.....在单窗体可以....
但连续窗体,数据表.....不行.........
Private b
Private Sub 堆头陈列商品_Change()
End Sub
Private Sub 堆头陈列商品_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp, vbKeyDown
Me.堆头陈列商品.OnChange = ""
Case Else
Me.堆头陈列商品.OnChange = "[Event Procedure]"
End Select
End Sub
Private Sub 堆头陈列商品_KeyUp(KeyCode As Integer, Shift As Integer)
Dim a As String
a = "*" & Me.堆头陈列商品.Text & "*"
Me.堆头陈列商品.RowSource = "SELECT 商品ID, 货品编号 FROM 商品目录 Where 货品编号 like '" & a & "';"
Me.堆头陈列商品.Dropdown
b = Me.堆头陈列商品.Column(0, 0)
End Sub
Private Sub 堆头陈列商品_NotInList(NewData As String, Response As Integer)
Dim ctl As Control
Set ctl = Me!堆头陈列商品
Response = acDataErrContinue
ctl.Undo
Me.堆头陈列商品 = b
Me.堆头陈列商品.RowSource = "SELECT 商品ID, 货品编号 FROM 商品目录;"
SendKeys ("{Tab}")
End Sub
Private b
Private Sub 堆头陈列商品_Change()
Dim a As String
a = "*" & Me.堆头陈列商品.Text & "*"
Me.堆头陈列商品.RowSource = "SELECT 商品ID, 货品编号 FROM 商品目录 Where 货品编号 like '" & a & "';"
Me.堆头陈列商品.Dropdown
b = Me.堆头陈列商品.Column(0, 0)
End Sub
Private Sub 堆头陈列商品_NotInList(NewData As String, Response As Integer)
Dim ctl As Control
Set ctl = Me!堆头陈列商品
Response = acDataErrContinue
ctl.Undo
Me.堆头陈列商品 = b
Me.堆头陈列商品.RowSource = "SELECT 商品ID, 货品编号 FROM 商品目录;"
SendKeys ("{Tab}")
End Sub
Private Sub chrWares_Change()
Me.chrWares.RowSource = "select id,chrwares from tbllist where chrwares like '*" & Me.chrWares.Text & "*';"
Me.chrWares.Dropdown
End Sub
Private Sub chrWares_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp, vbKeyDown
Me.chrWares.OnChange = ""
Case Else
Me.chrWares.OnChange = "[Event Procedure]"
End Select
End Sub
属性窗口中,“数据”页里的“自动展开”属性设为“否”
忒模糊了

上传示例
tttttttttttttttttttttttttttttttttttttttttttttt
总记录:4篇 页次:1/1 9 1 :