Office中国论坛/Access中国论坛

标题: 组合框模糊查询,单窗体可以,数据表跟连续窗体都不行.... [打印本页]

作者: ruanjy    时间: 2011-10-28 10:28
标题: 组合框模糊查询,单窗体可以,数据表跟连续窗体都不行....

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 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   

都失败............
作者: yangruihao    时间: 2011-10-30 08:24
我前两天也遇到类似的问题,至今未解决
作者: ruanjy    时间: 2011-12-2 23:22
我前两天也遇到类似的问题,至今未解决.....................顶起来。。到解决为止




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3