If e.Col.Name = "注册证号" Then \'如果编辑的是客户ID列
If e.Col.DroppedDown Then \'如果下拉窗口已经打开
Dim tbl As Table = Tables("输入注册证号弹出筛选窗口_Table1")
If e.Text = "" Then \'如果内容为空
tbl.Filter = "停用=false" \'显示所有客户
Else \'否则根据输入内容进行模糊筛选
Dim txt As String = "\'%" & e.Text & "%\'"
\'tbl.Filter = "注册证号 Like " & txt & " Or 生产企业 Like " & txt & " Or 名称 Like " & txt & " Or 规格型号 Like " & txt &""
tbl.Filter = "停用=false and 配送公司=\'" & e.Row("配送公司")& "\' (名称 Like " & txt & " Or 注册证号 Like " & txt & " Or 生产企业 Like " & txt & ")"
End If
End If
End If
下面是DropDownOpened的代码:
Dim txt As String = e.Form.DropDownBox.Text
Dim tbl As Table = Tables("输入注册证号弹出筛选窗口_Table1")
If txt = "" Then
tbl.Filter = "停用=false"
Else
txt = "\'%" & txt & "%\'"
\'tbl.Filter = "停用=false and (名称 Like " & txt & " Or 注册证号 Like " & txt & " Or 生产企业 Like " & txt & ")"
tbl.Filter = "停用=false and 配送公司=\'" & e.form.dropTable.current("配送公司") & "\' (名称 Like " & txt & " Or 注册证号 Like " & txt & " Or 生产企业 Like " & txt & ")"
End If
e.Form.DropDownBox.Select() \'将输入焦点返回下拉列表框