以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于checkbox错误  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=111793)

--  作者:hnguang
--  发布时间:2017/12/29 11:11:00
--  关于checkbox错误

图片点击可在新窗口打开查看此主题相关图片如下:1.jpg
图片点击可在新窗口打开查看

这段 代码会出现以下错误 

--  作者:hnguang
--  发布时间:2017/12/29 11:12:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:2.jpg
图片点击可在新窗口打开查看

--  作者:hnguang
--  发布时间:2017/12/29 11:13:00
--  
之前也有这样用过没有出错
--  作者:有点甜
--  发布时间:2017/12/29 12:09:00
--  

请不要截图,贴出你写的代码看看。


--  作者:hnguang
--  发布时间:2017/12/29 12:19:00
--  
Dim filter=""

Dim chk As WinForm.CheckBox
chk =  e.Form.Controls("chk_bh")
If chk.Checked = True
    If filter = "" Then
        filter= "工號=\'" & e.Form.Controls("txt_bh").text & "\' "
    End If
End If



If e.Form.Controls("姓名").checked= True Then
    If filter= "" Then
        filter= "姓名  Like \'%" & e.Form.Controls("txt_name").text & "%\' "
    Else
        filter+= " and 姓名  Like \'%" & e.Form.Controls("txt_name").text & "%\' "
    End If
End If

If e.Form.Controls("部门").checked= True Then
    If filter= "" Then
        filter= "部門  Like \'%" & e.Form.Controls("cmb_dept").text & "%\'  "
    Else
        filter+= " and 部門  Like \'%" & e.Form.Controls("cmb_dept").text & "%\'  "
    End If
End If

If e.Form.Controls(e.Form.Controls("职务")).checked= True Then
    If filter= "" Then
        filter= "職務  Like \'%" & e.Form.Controls("cmb_post").text & "%\'"
    Else
        filter+= " and 職務  Like \'%" & e.Form.Controls("cmb_post").text & "%\'"
    End If
End If

DataTables("tbl_rsfile").LoadFilter=filter
DataTables("tbl_rsfile").Load
Tables("tbl_rsfile").Sort="工號"

--  作者:有点甜
--  发布时间:2017/12/29 12:26:00
--  

If e.Form.Controls(e.Form.Controls("职务")).checked= True Then

 

改成

 

If e.Form.Controls("职务").checked= True Then

 

或者

 

If e.Form.Controls(e.Form.Controls("职务").Text).checked= True Then