Dim gzdw As WinForm.CheckedComboBox = e.Form.Controls("工作单位")
Dim xgs As WinForm.CheckedComboBox = e.Form.Controls("县公司")
Dim jdpc As WinForm.CheckedComboBox = e.Form.Controls("鉴定批次")
Dim jdgz As WinForm.CheckedComboBox = e.Form.Controls("鉴定工种")
Dim xm As WinForm.TextBox = e.Form.Controls("姓名")
Dim sfzhm As WinForm.TextBox = e.Form.Controls("身份证号码")
Dim zsbh As WinForm.TextBox = e.Form.Controls("证书编号")
Dim filter As String = "1=1"
If gzdw.Text > "" Then
filter &= " and 工作单位 in ('" & gzdw.Text.replace(",", "','") & "')"
End If
If xgs.Text > "" Then
filter &= " and 县公司 = in ('" & xgs.Text.replace(",", "','") & "')"
End If
If jdpc.Text > "" Then
filter &= " and 鉴定批次 in ('" & jdpc.Text.replace(",", "','") & "')"
End If
If jdgz.Text > "" Then
filter &= " and 鉴定工种 in ('" & jdgz.Text.replace(",", "','") & "')"
End If
If xm.Text > "" Then
filter &= " and 姓名 like '*" & xm.Text & "*' "
End If
If sfzhm.Text > "" Then
filter &= " and 身份证号码 like '*" & sfzhm.Text & "*'"
End If
If zsbh.Text > "" Then
filter &= " and 证书编号 like '*" & zsbh.Text & "*'"
End If
Tables("证书编号表").Filter = filter
这是窗口“查询”按钮的代码