此主题相关图片如下:11.png
此主题相关图片如下:12.png
老师们,请看,搜索“天津地铁7号线”,实际上记录有10个,搜索出来的只有4个
此主题相关图片如下:13.png
另外,按日期搜索,实际有8个2016年的记录,但是只搜索出来2个。
这是代码,老师们请看:
Dim num As WinForm.TextBox = e.Form.Controls("文件编号")
Dim pjsort As WinForm.ComboBox = e.Form.Controls("项目分类")
Dim text As WinForm.TextBox = e.Form.Controls("文件内容")
Dim zhye As WinForm.CheckedComboBox = e.Form.Controls("相关专业")
Dim sort As WinForm.ComboBox = e.Form.Controls("文件类别")
Dim company As WinForm.ComboBox = e.Form.Controls("发放单位")
Dim linkman As WinForm.TextBox = e.Form.Controls("联系人")
Dim jscompany As WinForm.CheckedComboBox = e.Form.Controls("接收单位")
Dim StartDate As WinForm.DateTimePicker = e.Form.Controls("起始日期")
Dim EndDate As WinForm.DateTimePicker = e.Form.Controls("终止日期")
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' "
End If
If Trim(pjsort.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*'"
Else
Tables("总表").Filter="项目分类 like '*" & Trim(pjsort.Text) & "*'"
End If
End If
If Trim(text.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*'"
Else
Tables("总表").Filter="文件内容 like '*" & Trim(text.Text) & "*'"
End If
End If
If Trim(zhye.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*'"
Else
Tables("总表").Filter="相关专业 like '*" & Trim(zhye.Text) & "*'"
End If
End If
If Trim(sort.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*' and 文件类别 like '*" & Trim(sort.Text) & "*'"
Else
Tables("总表").Filter="文件类别 like '*" & Trim(sort.Text) & "*'"
End If
End If
If Trim(company.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*' and 文件类别 like '*" & Trim(sort.Text) & "*' and 发放单位 like '*" & Trim(company.Text) & "*'"
Else
Tables("总表").Filter="发放单位 like '*" & Trim(company.Text) & "*'"
End If
End If
If Trim(linkman.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*' and 文件类别 like '*" & Trim(sort.Text) & "*' and 发放单位 like '*" & Trim(company.Text) & "*' and 联系人 like '*" & Trim(linkman.Text) & "*'"
Else
Tables("总表").Filter="联系人 like '*" & Trim(linkman.Text) & "*'"
End If
End If
If Trim(jscompany.Text) IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*' and 文件类别 like '*" & Trim(sort.Text) & "*' and 发放单位 like '*" & Trim(company.Text) & "*' and 联系人 like '*" & Trim(linkman.Text) & "*' and 接收单位 like '*" & Trim(jscompany.Text) & "*'"
Else
Tables("总表").Filter="接收单位 like '*" & Trim(jscompany.Text) & "*'"
End If
End If
If StartDate.value IsNot Nothing And EndDate.value IsNot Nothing Then
If Tables("总表").Filter IsNot Nothing Then
Tables("总表").Filter= "文件编号 like '*" & Trim(num.Text) & "*' and 项目分类 like '*" & Trim(pjsort.Text) & "*' and 文件内容 like '*" & Trim(text.Text) & "*' and 相关专业 like '*" & Trim(zhye.Text) & "*' and 文件类别 like '*" & Trim(sort.Text) & "*' and 发放单位 like '*" & Trim(company.Text) & "*' and 联系人 like '*" & Trim(linkman.Text) & "*' and 接收单位 like '*" & Trim(jscompany.Text) & "*' and 日期 >= #" & StartDate.value & "# And 日期 <= #" & EndDate.value & "#"
Else
Tables("总表").Filter="日期 >= #" & StartDate.value & "# And 日期 <= #" & EndDate.value & "#"
End If
End If