ChangeEdit 事件的代码
Dim psgs As String=Forms("来货录入小窗口").controls("DropBox1").text
If e.Col.Name = "中标号或编号" Then '如果编辑的是客户ID列
If e.Col.DroppedDown Then '如果下拉窗口已经打开
Dim tbl As Table = Tables("来货快速录入弹出筛选窗口_Table1")
If e.Text = "" Then '如果内容为空
tbl.Filter = "" '显示所有客户
Else '否则根据输入内容进行模糊筛选
Dim txt As String = "'%" & e.Text & "%'"
' tbl.Filter = "配送公司='"& psgs &"' And (中标号或编号 Like " & txt & " Or 通用名称 Like " & txt & " Or 规格型号 Like " & txt.replace("*", "[*]") & " Or 生产企业 Like " & txt &" Or 简码 Like " & txt & ")"
Dim mf As String= "配送公司='"& psgs &"' And (中标号或编号 Like " & txt & " Or 通用名称 Like " & txt & " Or 规格型号 Like " & txt.replace("*", "[*]") & " Or 生产企业 Like " & txt &" Or 简码 Like " & txt & ")"
Dim drs = tbl.DataTable.Select(mf, "计划日期 desc")
Dim filter As String = "1=2"
If drs.count >= 5 Then
For i As Integer = 0 To 4
filter &= " or _Identify = " & drs(i)("_Identify")
Next
Else
For Each r As Row In drs
filter &= " or _Identify = " & r("_Identify")
Next
End If
tbl.filter = filter
tbl.sort="计划日期 DESC"
End If
End If
End If
If e.Col.Name = "注册证号" Then '如果编辑的是客户ID列
If e.Col.DroppedDown Then '如果下拉窗口已经打开
Dim tbl As Table = Tables("输入注册证号弹出筛选窗口_Table1")
If e.Text = "" Then '如果内容为空
tbl.Filter = "" '显示所有客户
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("配送公司")& "' and (名称 Like " & txt & " Or 注册证号 Like " & txt & " Or 生产企业 Like " & txt & ")"
End If
End If
End If