Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/20 14:10:00 [显示全部帖子]

分开写不就可以了?如果有问题,做个具体例子发上来测试。


If e.Form.Controls("rdoYifu").Checked = True
    Dim  t = Tables("人员")
    Dim Filter As String = ""
    With e.Form.Controls("cmbProduct")
        If .Value IsNot Nothing Then
            Filter = "产品 = '" & .Value & "'"
        End If
    End With
    With e.Form.Controls("cmbCustomer")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "客户 = '" & .Value & "'"
        End If
    End With
    t.Filter = Filter
ElseIf e.Form.Controls("rdoWeifu").Checked = True
    Dim  t = Tables("物资")
    Dim Filter As String = ""
    With e.Form.Controls("cmbProduct")
        If .Value IsNot Nothing Then
            Filter = "产品 = '" & .Value & "'"
        End If
    End With
    With e.Form.Controls("cmbCustomer")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "客户 = '" & .Value & "'"
        End If
    End With
    t.Filter = Filter   
End If


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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/20 16:44:00 [显示全部帖子]

做一个窗口【窗口2】,放入一个table控件【Table1】,然后改代码。

 

If e.Form.Controls("人员").Checked = True
    Forms("窗口2").Show
    Dim t = Forms("窗口2").Controls("Table1").Table
    t.DataSource = DataTables("人员")
    Dim Filter As String = ""
    With e.Form.Controls("ComboBox1")
        If .Value IsNot Nothing Then
            Filter = "name= '" & .Value & "'"
        End If
    End With
    With e.Form.Controls("ComboBox2")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "bh= '" & .Value & "'"
        End If
    End With
    t.Filter = Filter

[此贴子已经被作者于2017/6/21 9:07:51编辑过]

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/20 18:03:00 [显示全部帖子]

 你为什么要给窗口的table增加列?

 

 只能用代码增加 http://www.foxtable.com/webhelp/scr/1428.htm

 

[此贴子已经被作者于2017/6/20 18:03:39编辑过]

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/21 9:09:00 [显示全部帖子]

If e.Form.Controls("人员").Checked = True
   Forms("搜索结果").Show
    Dim t = Forms("搜索结果").Controls("Table1").Table
    t.DataSource = DataTables("人员")
    Dim Filter As String = ""
    With e.Form.Controls("ComboBox1")
        If .Value IsNot Nothing Then
            Filter = "name= '" & .Value & "'"
        End If
    End With
    With e.Form.Controls("ComboBox2")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "bh= '" & .Value & "'"
        End If
    End With
    t.Filter = Filter
ElseIf e.Form.Controls("物资").Checked = True
    Forms("搜索结果").Show
    Dim t = Forms("搜索结果").Controls("Table1").Table
    t.DataSource = DataTables("物资")
    Dim Filter As String = ""
    With e.Form.Controls("ComboBox1")
        If .Value IsNot Nothing Then
            Filter = "wzmc= '" & .Value & "'"
        End If
    End With
    With e.Form.Controls("ComboBox2")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "bh= '" & .Value & "'"
        End If
    End With
    t.Filter = Filter   
End If


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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/21 9:33:00 [显示全部帖子]


 回到顶部