我就是加载表。如果筛选出来的是空表就会报上面的错。
按钮代码
Dim kh As WinForm.ComboBox = e.Form.Controls("客户")
Dim bdjx As WinForm.ComboBox = e.Form.Controls("博达机型")
Dim startdate As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim enddate As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")
If User.Name.Trim() = "jichenggang@bdcom.com.cn" Or User.Name.Trim() = "liujiyong@bdcom.com.cn" Then
Dim filter = DataTables("临时版本跟踪表").LoadFilter
If filter > "" Then filter &= " and "
If kh.text = "" And bdjx.text = "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "'"
ElseIf kh.text <> "" And bdjx.text <> "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 客户 = '" & kh.text & "' and 博达机型 = '" & bdjx.text & "'"
ElseIf kh.text <> "" And bdjx.text = "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 客户 = '" & kh.text & "'"
ElseIf kh.text = "" And bdjx.text <> "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 博达机型 = '" & bdjx.text & "'"
End If
Else
Select Case user.Group
Case "录入","审核","协议一组","协议二组","交换组","R驱动组","S驱动组","EPON组","ONU组","网管组","网络组","路由组","PTN应用组","链路组","测试epon","测试switch","测试router"
Dim filter = DataTables("临时版本跟踪表").LoadFilter
If filter > "" Then filter &= " and "
If kh.text = "" And bdjx.text = "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "'"
ElseIf kh.text <> "" And bdjx.text <> "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 客户 = '" & kh.text & "' and 博达机型 = '" & bdjx.text & "'"
ElseIf kh.text <> "" And bdjx.text = "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 客户 = '" & kh.text & "'"
ElseIf kh.text = "" And bdjx.text <> "" Then
DataTables("临时版本跟踪表").LoadFilter = filter & "需求提交时间 > '" & startdate.Value & "' And 需求提交时间 < '" & enddate.value.AddDays(1) & "' and 博达机型 = '" & bdjx.text & "'"
End If
End Select
End If
DataTables("临时版本跟踪表").Load