Dim filter As String
Dim dtp1 As Date
Dim dtp2 As Date
Dim cmb As String
dtp1 = e.Form. Controls("起始日期").text
dtp2 = e.Form. Controls("结束日期").text
cmb = e.Form. Controls("档案类型").text
If dtp1 = Nothing
Messagebox.show("请输入起始日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
Else If dtp2 = Nothing
Messagebox.show("请输入结束日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
Else If cmb = Nothing
Messagebox.show("请输入档案类型!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
DataTables("档案明细查询_Table1").Fill("Select * From {档案管理明细} Where 归档日期 >= #" & dtp1 & "# And 归档日期 <= #" & dtp2 & "# And 档案类型 = '" & cmb & "' ","sqlserver",True)