以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]这样的筛选如何做?[已解决]  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=60081)

--  作者:rophy0952
--  发布时间:2014/11/18 8:53:00
--  [求助]这样的筛选如何做?[已解决]
如图,对窗口控件的值进行筛选,其中用到radiobutton控件,我试着录入代码,但结果不对,请指教 !

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20141118084900.png
图片点击可在新窗口打开查看

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
With e.Form.Controls("已完成")
    If .checked = False Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = true"
    End If
End With
With e.Form.Controls("未完成")
    If .checked = False Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = false"
    End If
End With
With e.Form.Controls("全部")
    Filter = Filter & " And "
End With
If Filter > "" Then
    DataTables("收款主表").loadFilter = Filter
    DataTables("收款主表").load
End If
[此贴子已经被作者于2014-11-18 10:30:38编辑过]

--  作者:Bin
--  发布时间:2014/11/18 8:57:00
--  
With e.Form.Controls("全部")
    Filter = Filter & " And "
End With   

这段去掉

--  作者:rophy0952
--  发布时间:2014/11/18 9:00:00
--  
去掉那段代码以后,执行代码提示:

.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.10.23.1
错误所在事件:加载[收款主表]失败!
详细错误信息:
至少一个参数没有被指定值。


--  作者:Bin
--  发布时间:2014/11/18 9:02:00
--  
把你拼接的FIlter 弹出来看看


--  作者:有点甜
--  发布时间:2014/11/18 9:05:00
--  

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
With e.Form.Controls("已完成")
    If .checked = True Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = true"
    End If
End With
With e.Form.Controls("未完成")
    If .checked = True Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = false"
    End If
End With

If Filter > "" Then
    DataTables("收款主表").loadFilter = Filter
    DataTables("收款主表").load
End If

 


--  作者:rophy0952
--  发布时间:2014/11/18 9:11:00
--  
上了例子,麻烦帮忙看一下,谢谢!
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:问题.foxdb



--  作者:有点甜
--  发布时间:2014/11/18 9:35:00
--  

Dim Filter As String = "1=1"
With e.Form.Controls("生产单号")
    If .Value IsNot Nothing Then
        Filter = " and 生产单号 = \'" & .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
With e.Form.Controls("已完成")
    If .checked = True Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = true"
    End If
End With
With e.Form.Controls("未完成")
    If .checked = True Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "已完成 = false"
    End If
End With

    DataTables("生产主表").loadFilter = Filter
    DataTables("生产主表").load


--  作者:TongOk
--  发布时间:2014/11/19 17:28:00
--  
晕,这种问题咋没人解答啊。5月份提的,现在都没人解答图片点击可在新窗口打开查看
--  作者:有点甜
--  发布时间:2014/11/19 17:30:00
--  
以下是引用TongOk在2014-11-19 17:28:00的发言:
晕,这种问题咋没人解答啊。5月份提的,现在都没人解答图片点击可在新窗口打开查看

 

什么问题?顶上来看看。