|
本帖最后由 todaynew 于 2010-11-19 16:29 编辑
Private Sub 产品编号_NotInList(NewData As String, Response As Integer)
Dim ssql As String
Dim WH As String
Response = acDataErrContinue
ssql = "SELECT cpk.产品编号, '名称:' & [产品名称及规格] & ' 颜色:' & [颜色] & ' 单位:' & [单位] AS 品名 FROM cpk"
WH = " Where instr([产品名称及规格] & [颜色] & [单位],'" & NewData & "')>0"
Me.产品编号.RowSource = ssql & WH
If Me.产品编号.ListCount = 1 Then
Me.产品编号.Value = Me.产品编号.Column(0, 0)
ssql = "SELECT cpk.产品编号, '名称:' & [产品名称及规格] & ' 颜色:' & [颜色] & ' 单位:' & [单位] AS 品名 FROM cpk"
Me.产品编号.RowSource = ssql
Me.进货数量.SetFocus
Else
Me.产品编号.Dropdown
End If
End Sub
修改为:
Private Sub 产品编号_NotInList(NewData As String, Response As Integer)
Dim ssql As String
Dim WH As String
Response = acDataErrContinue
ssql = "SELECT cpk.产品编号, '名称:' & [产品名称及规格] & ' 颜色:' & [颜色] & ' 单位:' & [单位] AS 品名 FROM cpk"
WH = " Where instr([产品名称及规格] & [颜色] & [单位],'" & NewData & "')>0"
Me.产品编号.RowSource = ssql & WH
Me.产品编号.Dropdown
End Sub
|
|