以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]按年龄查询  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=134881)

--  作者:lhx
--  发布时间:2019/5/11 13:20:00
--  [求助]按年龄查询
老师,我的员工信息表中有年龄列,我建了两个NumericComboBox,分别是Num1 和Num2,想查询输入的某个年龄段的数据,套入以下代码无反应,
刚开始接触foxtablei很多不懂的,麻烦老师帮忙指导一下,谢谢
Tables("员工信息").Filter = ""
Dim Filter As String
With e.Form.Controls("Num1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年龄 >= \'" & .Value & "\'"
    End If
    Tables("员工信息").Filter =Filter
End With
With e.Form.Controls("Num2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年龄 <= \'" & .Value & "\'"
    End If
End With

--  作者:有点蓝
--  发布时间:2019/5/11 13:45:00
--  
Dim Filter As String
With e.Form.Controls("Num1")
    If .Value <> Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年龄 >= \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("Num2")
    If .Value <> Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年龄 <= \'" & .Value & "\'"
    End If
End With

    Tables("员工信息").Filter =Filter

--  作者:lhx
--  发布时间:2019/5/11 14:04:00
--  
原来如此,谢谢老师