Foxtable(狐表)用户栏目专家坐堂 → 代码错误


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

主题:代码错误

美女呀,离线,留言给我吧!
cocodingding
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:22 积分:229 威望:0 精华:0 注册:2016/12/6 23:47:00
代码错误  发帖心情 Post By:2016/12/10 21:03:00 [只看该作者]


显示错误信息:“字符串未被识别为有效的 DateTime。有一个从索引 9 处开始的未知字”。
前面的筛选OK,时间不能运行


Dim Filter As String
With e.Form.Controls("产品")
    If .Value IsNot Nothing Then
        Filter = "产品 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("业务员")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "业务员= '" & .Value & "'"
    End If
End With
With e.Form.Controls("业务员上级")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "业务员上级= '" & .Value & "'"
    End If
End With
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "订单日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "订单日期 <= #" & .Value & "#"
    End If
End With
If Filter > "" Then
    Tables("订单明细表").Filter = Filter
End If

 回到顶部