--
这个是查询按钮中click事件代码。
Dim dq As WinForm.ComboBox = e.Form.Controls("地区")
Dim dj As WinForm.ComboBox = e.Form.Controls("供应商等级")
Dim lb As WinForm.ComboBox = e.Form.Controls("供应商类别")
Dim tj As WinForm.TextBox = e.Form.Controls("搜索条件")
Dim filter As String = GYS_Filter
\'如果地区为空,则不进行搜索
If dq.value IsNot Nothing Then
filter=filter & " and "
filter=filter & "地区=\'" & dq.value & "\'"
End If
\'如果供应商等级为空,则不进行搜索
If dj.value IsNot Nothing Then
filter=filter & " and "
filter=filter & "供应商等级=\'" & dj.value & "\'"
End If
\'如果供应商类别为空,则不进行搜索
If lb.value IsNot Nothing Then
filter=filter & " and "
filter=filter & "供应商类别=\'" & lb.value & "\'"
End If
\'如果搜索内容为空,则不进行搜索
If tj.value IsNot Nothing Then
Filter = Filter & " And "
Dim kh As String
kh = "*" & tj.text & "*"
filter=filter & cexp("供应商全称 like \'{0}\' or 电话 like \'{1}\' or 供应商主营 like \'{2}\' or 供应商编号 like \'{3}\'" , kh , kh , kh, kh )
End If
Tables("客户").Filter=Filter
此主题相关图片如下:qq截图20140903112650.png
此主题相关图片如下:qq图片20140903105539.jpg
项目属性loaduser事件代码为:
GYS_Filter="开发采购员 = \'" & user.name & "\'" \'定义全局变量,用于客户的筛选的初始内容.