Foxtable(狐表)用户栏目专家坐堂 → 请问哪里有错?


  共有2207人关注过本帖树形打印复制链接

主题:请问哪里有错?

帅哥哟,离线,有人找我吗?
kmzb56
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:528 积分:5034 威望:0 精华:0 注册:2012/4/6 19:31:00
请问哪里有错?  发帖心情 Post By:2018/11/25 22:51:00 [显示全部帖子]

With e.Form.Controls("TextBox1")
If .value IsNot Nothing Then
     Filter="收入 =.Value "
    End If
End With


With e.Form.Controls("TextBox2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "支出 =.Value "
    End If
End With
With e.Form.Controls("TextBox3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "余额=.Value "
    End If
End With
With e.Form.Controls("TextBox4")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter  & "说明  like '*" & .Value & "*'"
    End If
End With
With e.Form.Controls("TextBox5") 
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "经手人 Like  '*" & .Value & "*'"
    End If
End With

If Filter > "" Then
    Tables("收付款帐户_Table1").Filter = Filter
怎么执行不了?谢谢!

 回到顶部
帅哥哟,离线,有人找我吗?
kmzb56
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:528 积分:5034 威望:0 精华:0 注册:2012/4/6 19:31:00
  发帖心情 Post By:2018/11/27 21:56:00 [显示全部帖子]

Dim Filter As String
With e.Form.Controls("DateTimePicker1")
If .value IsNot Nothing Then
     Filter="日期 = #" & .Value & "#"
    End If
End With
 With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "收入 = '" & .Value & "'"
    End If
End With

 With e.Form.Controls("TextBox2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "支出 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("TextBox3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "余额 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("TextBox4")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter  & "说明  like '%" & .Value & "%'"
    End If
End With
With e.Form.Controls("TextBox5") 
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If 
        Filter = Filter & "经手人 Like  '%" & .Value & "%'"
    End If
End With


If Filter > "" Then
    Tables("收付款帐户_Table1").Filter = Filter
End If


加上日期又不对了。

 回到顶部