Foxtable(狐表)用户栏目专家坐堂 → 我晕了,这个表达式怎么不能连接起来


  共有3912人关注过本帖平板打印复制链接

主题:我晕了,这个表达式怎么不能连接起来

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


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
我晕了,这个表达式怎么不能连接起来  发帖心情 Post By:2013/10/22 22:24:00 [只看该作者]

Dim dt As DataTable = Tables(e.form.Name & "_Table1").DataTable
Dim Filter As String
Dim T As String = e.form.Controls("TextBox1").Value '定义控件的值
For Each dc As DataCol In dt.DataCols '遍历表的所有列
    If dc.IsDate OrElse dc.IsBoolean OrElse dc.IsNumeric Then  '如果是时间列,逻辑列,数值列
        Continue For    '排除
    End If
    If Filter = "" Then
        Filter = Filter & "[" & dc.Name & "] Like '%" & T & "%'" '根据控件值迷糊筛选
    Else
        Filter = Filter & " or [" & dc.Name & "] Like '%" & T & "%'" '根据控件值迷糊筛选
    End If
Next

With e.Form.Controls("报表名称")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = "报表名称 = '" & .Value & "'"
    End If
End With

With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "年 = '" & .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 & "月 = '" & .Value & "'"
    End If
End With
MessageBox.Show(Filter)

 

 

 

第一段的模糊筛选和第二段的报表名称 怎么连不起来了 我晕死了


 回到顶部