1、名称要和列一致
2、
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 & "%'"
ElseIf c.IsBoolean AndAlso e.Form.Controls(ctl.Name).Check Then
msgbox(c.Name)
flt + = " And " & c.Name & " = " & e.Form.Controls(ctl.Name).Checked
End If
End If
End If
Next
Next