Foxtable(狐表)用户栏目专家坐堂 → 代码不执行


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

主题:代码不执行

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


加好友 发短信
等级:童狐 帖子:203 积分:1368 威望:0 精华:0 注册:2017/12/4 15:36:00
代码不执行  发帖心情 Post By:2018/1/23 16:49:00 [只看该作者]

Dim nms() As String = {"产品型号","第一份_领取人","工序号", "领取日期" ,"返回日期"}
Dim sps() As String = {"'","'","'","#","#"}
Dim bjf() As String = {"=","=","=",">=","<="}
Dim fds() As String = {"产品型号","第一份_领取人","工序号","日期","日期"}
Dim Filter As String
For i As Integer = 0 To nms.Length - 1
 If e.Form.Controls(nms(i)).value IsNot Nothing Then
      If filter > "" Then
      filter = filter & "and"
     End If
   filter =filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i)
  End  If
Next
If e.Form.Controls( "已还").checked = True
     If filter > "" Then 
       filter = filter & "and"
End If
filter=filter & "已还 = true"
End If
If e.Form.Controls( "已还").checked = True
     If filter > "" Then 
       filter = filter & "and"
End If
filter=filter & "未还 =false or 未还 is null"
End If

Tables("工艺卡片发放记录").filter = filter

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
麻烦老师帮忙看一下   代码那个部分写的有问题 为什么不执行呢


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/23 16:57:00 [只看该作者]

filter=filter & "未还 =false or 未还 is null"

 

改成

 

filter=filter & "(未还 =false or 未还 is null)"


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/23 16:57:00 [只看该作者]

你加上代码 msgbox(filter) 看弹出什么。


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


加好友 发短信
等级:童狐 帖子:203 积分:1368 威望:0 精华:0 注册:2017/12/4 15:36:00
  发帖心情 Post By:2018/1/24 8:20:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:3.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看
Dim nms() As String = {"产品型号","领取人","检具代码", "领取日期" ,"返回日期"}
Dim sps() As String = {"'","'","'","#","#"}
Dim bjf() As String = {"=","=","=",">=","<="}
Dim fds() As String = {"产品型号","领取人","检具代码","日期","日期"}
Dim Filter As String
For i As Integer = 0 To nms.Length - 1
 If e.Form.Controls(nms(i)).value IsNot Nothing Then
      If filter > "" Then
      filter = filter & "and"
     End If
   filter =filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i)
  End  If
Next
If e.Form.Controls( "已还").checked = True
     If filter > "" Then 
       filter = filter & "and"
End If
filter=filter & "已还=true"
End If
If e.Form.Controls( "已还").checked = True
     If filter > "" Then 
       filter = filter & "and"
End If
filter=filter & "(未还 =false or 未还 is null)"
msgbox(filter) 
End If

Tables("检具明细表").filter = filter
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/24 8:44:00 [只看该作者]

Dim nms() As String = {"产品型号","领取人","检具代码", "领取日期" ,"返回日期"}
Dim sps() As String = {"'","'","'","#","#"}
Dim bjf() As String = {"=","=","=",">=","<="}
Dim fds() As String = {"产品型号","领取人","检具代码","日期","日期"}
Dim Filter As String
For i As Integer = 0 To nms.Length - 1
    If e.Form.Controls(nms(i)).value IsNot Nothing Then
        If filter > "" Then
            filter = filter & " and "
        End If
        filter =filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i)
    End  If
Next
If e.Form.Controls( "已还").checked = True
    If filter > "" Then
        filter = filter & " and "
    End If
    filter=filter & " 已还=true"End If
If e.Form.Controls( "未还").checked = True
    If filter > "" Then
        filter = filter & " and "
    End If
    filter=filter & " (未还 =false or 未还 is null)"

End If

    msgbox(filter)

Tables("检具明细表").filter = filter


 回到顶部