Dim Filter As String
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
Filter ="产品编号 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "订单编号 Like '%" & .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 & "部门 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "开始时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
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
以上这是一个查询按钮,在窗口中,窗口中也有相应的一个表,但是执行之后原来的的表就变成了白色,什么都看不到?是那里问题?要怎么改?