Dim Filter As String With e.Form.Controls("TextBox1") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "年龄 >= " & .Value End If End With With e.Form.Controls("TextBox2") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "年龄 <= " & .Value End If End With With e.Form.Controls("CheckBox1") If .Checked Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "社保 = 'True'" End If End With With e.Form.Controls("CheckBox2") If .Checked Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "工伤 = 'True'" End If End With If Filter > "" Then Tables("表A").Filter = Filter End If
|