vars("查询") = True
Dim flt As String
For Each c As Col In Tables("机房板件端口表").Cols
For Each ctl As WinForm.Control In e.Form.Controls
If c.Name = ctl.Name Then
If e.Form.Controls(ctl.Name).Text > "" Then
If c.IsDate Then
flt + = " And " & c.Name & " = #" & e.Form.Controls(ctl.Name).Text & "#"
ElseIf c.IsString Then
flt + = " And " & c.Name & " Like \'%" & e.Form.Controls(ctl.Name).Text & "%\'"
End If
End If
End If
Next
Next
If flt > "" Then
flt = flt.SubString(5)
Else
MessageBox.Show("请输入查询条件")
End If
Tables("机房板件端口表").Filter = flt
vars("查询") = False