以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码出错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=86651)

--  作者:张子俊
--  发布时间:2016/6/22 16:25:00
--  代码出错

在一个查询窗口中有组合框和 复选框两个控件。查询按钮的代码哪里出现了问题。求指点,谢谢

显示错误信息

.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2016.4.17.1
错误所在事件:窗口,水井管理系统,Button1,Click
详细错误信息:
未找到类型“CheckBox”的公共成员“Value”。

Dim Filter As String
With e.Form.Controls("姓名")
    If .Value IsNot Nothing Then
        Filter = "姓名= \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("已付款")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已付款= \'" & .Value & "\'"
    End If
End With

If Filter > "" Then
   
    Tables("明细").Filter = Filter


--  作者:大红袍
--  发布时间:2016/6/22 16:28:00
--  

Dim Filter As String = "1=1"
With e.Form.Controls("姓名")
    If .Value IsNot Nothing Then
        Filter = Filter &" And 姓名= \'" & .Value & "\'"
    End If
End With

Filter = Filter & " and 已付款 = " & e.Form.Controls("已付款").Checked

Tables("明细").Filter = Filter