此主题相关图片如下:11111.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2021-4/20214171093282083.png)
我想做一下这样的查询表,这样写,表上不显示数据!Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "分类 = '" & .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 & "Month(日期) = '" & Month(.Value) & "'"
End If
End With
With e.Form.Controls("DropBox1")
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
With DataTables("车辆缴费情况查询_Table1")
If Filter > "" Then
LockBaseMainForm() '锁定主界面
.StopRedraw()
For i As Integer = .DataRows.count - 1 To 0 Step -1
.DataRows(i).Delete
Next
.LoadFilter = Filter
.LoadOrder = "日期"
.Load()
.ResumeRedraw()
UnLockBaseMainForm() '解锁主界面
End If
End With