模糊匹配:编号,姓名,部门,职务,简拼也行
范例文件:传统编辑模式
1.建一窗口1
2.插入:ComboBox1,Table1
3.ComboBox1的TextChanged事件代码:
Dim Ts As String() = {"编号","姓名","部门","职务"}
Dim t As Table =Tables("窗口1_Table1")
Dim st,ls ,py,Lm,str,Lss As String
st = e.sender.Text.ToUpper
If st IsNot Nothing Then
For Each Lm In Ts
For Each dr As DataRow In DataTables("员工").DataRows
py = GetPY(dr(Lm),True)
If dr(Lm).IndexOf(st)> -1 OrElse py.IndexOf(st) > -1 Then
If Ls Is Nothing Then
Ls = dr("_Identify")
Else
If Ls.IndexOf(dr("_Identify")) = -1 Then
ls+= "," & dr("_Identify")
End If
End If
If Lss Is Nothing Then
Lss = dr(Lm)
Else
If Lss.IndexOf(dr(Lm)) = -1 Then
Lss+ = "|" & dr(Lm)
End If
End If
End If
Next
Next
If ls IsNot Nothing Then
Ls ="[_Identify] In(" & Ls & ")"
Ls="select 编号,姓名 ,部门,职务 from{员工} where " & Ls
t.Fill(Ls,True)
e.sender.ComboList = Lss
End If
End If