以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  加载代码求助  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=150970)

--  作者:段虎成
--  发布时间:2020/6/11 15:49:00
--  加载代码求助

\'设置加载条件

Dim Filter As String

With e.Form.Controls("TextBox1")

    If .Value IsNot Nothing Then

        Filter = "客户名称 Like \'%" & .Value & "%\'"

    End If

End With

With e.Form.Controls("riqi1")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "签单日期 >= \'" & .Value & "\'"

    End If

End With

With e.Form.Controls("riqi2")

    If .Value IsNot Nothing Then

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "签单日期 <= \'" & .Value & "\'"

    End If

End With

If user.IsRole("数据全享小组")  Then

ElseIf user.name = "员工A" Then

    If Filter >"" Then

        Filter = Filter & " And "

    End If

Filter = Filter & "分支机构 = \'A分公司\'"

    老师您好,如果员工A同时负责两个分公司:A分公司、B分公司,这个地方代码我改怎么调整?

   

Else

        If Filter >"" Then

            Filter = Filter & " And "

        End If

        Filter = Filter & "签约人 = \'" & user.name & "\'"

End If

 

If Filter > ""  Then

    With DataTables("销售报表")

        .LoadFilter = Filter

        .Load()

    End With

End If


--  作者:有点蓝
--  发布时间:2020/6/11 15:53:00
--  
Filter = Filter & "分支机构 in (\'A分公司\',\'B分公司\')"
--  作者:段虎成
--  发布时间:2020/6/11 16:12:00
--  
谢谢老师!