各位高手,请帮忙看下以下查询代码不能实现查询功能,前段时间都可以,现在不行了,另我的系统所有数据表格也看不到,请指点下,谢谢!
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("尺码")
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("开始日期")
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
If Filter > "" Then
Tables("出入库明细").Filter = Filter
End If

此主题相关图片如下:qq图片20140603224026.jpg