以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  菜单栏问题求教!  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=134080)

--  作者:lisheng1971
--  发布时间:2019/4/26 16:40:00
--  菜单栏问题求教!
窗口1中有一查询按钮1,想把它的功能移植到菜单栏中的查询按钮中,是否可行?代码原封不动代入报错,请版主指教。
--  作者:lisheng1971
--  发布时间:2019/4/26 16:43:00
--  
窗口中查询按钮Click事件代码如下:

Dim gzdw As WinForm.CheckedComboBox = e.Form.Controls("工作单位")
Dim pjpc As WinForm.CheckedComboBox = e.Form.Controls("评价批次")
Dim xm As WinForm.TextBox = e.Form.Controls("姓名")
Dim sfzhm As WinForm.TextBox = e.Form.Controls("身份证号码")

Dim filter As String = "1=1"
If gzdw.Text > "" Then
    filter &= " and 工作单位 in (\'" & gzdw.Text.replace(",", "\',\'") & "\')"
End If
If pjpc.Text > "" Then
    filter &= " and  评价批次 in (\'" & pjpc.Text.replace(",", "\',\'") & "\')"
End If
If xm.Text > "" Then
    filter &= " and  姓名 like \'*" & xm.Text & "*\' "
End If
If sfzhm.Text > "" Then
    filter &= " and  身份证号码 like \'*" & sfzhm.Text & "*\'"
End If

Tables("技能评价表").Filter = filter

--  作者:有点蓝
--  发布时间:2019/4/26 17:04:00
--  
e.Form改为Forms("窗口1")

先判断窗口是否打开

--  作者:lisheng1971
--  发布时间:2019/4/28 10:38:00
--  
Tables("表A").Filter = "[资格审核]= True " And "[等级] = \'初级\' or [等级] = \'中级\' or [等级] = \'高级\'"

菜单栏有按钮A,点击后在窗口1中显示表A中符合:资格审核为TRUE且等级为初级、中级、高级的行,上述代码总报错,请版主指教。

--  作者:有点甜
--  发布时间:2019/4/28 10:47:00
--  

 

Tables("表A").Filter = "[资格审核]= True  And ([等级] = \'初级\' or [等级] = \'中级\' or [等级] = \'高级\')"