Dim Filter As String=""
Dim khmcmhcz As WinForm.CheckBox = e.Form.Controls("kuhumohuchaxunCheckBox")
With e.Form.Controls("kehuxingmingTextBox2")
If .Value IsNot Nothing Then
If khmcmhcz.Checked Then
Filter &= "客户姓名 like '%" & .Value & "%'"
Else
Filter &= "客户姓名= '" & .Value & "'"
End If
End If
End With
Dim sfzhmhcz As WinForm.CheckBox = e.Form.Controls("shenfenzhengmohuchaxunCheckBox")
With e.Form.Controls("shenfenzhenghaoTextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If sfzhmhcz.Checked Then
Filter &= "身份证号 Like '%" & .Value & "%'"
Else
Filter &= "身份证号= '" & .Value & "'"
End If
End If
End With
With e.Form.Controls("kehuxingbieComboBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "性别= '" & .Value & "'"
End If
End With
Dim sjmhcz As WinForm.CheckBox = e.Form.Controls("shoujimohuchaxunCheckBox")
With e.Form.Controls("shoujihaoTextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If sjmhcz.Checked Then
Filter &="客户主手机号 like '%" & .Value & "%' Or 第二手机号 like '%" & .Value & "%' Or 第三手机号 Like '%" & .Value & "%'"
Else
Filter &= "客户主手机号 = '" & .Value & "' Or 第二手机号= '" & .Value & "' Or 第三手机号 = '" & .Value & "'"
End If
End If
End With
Dim dzmhcz As WinForm.CheckBox = e.Form.Controls("dizhimohuchaxunCheckBox")
With e.Form.Controls("kehudizhiTextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If dzmhcz.Checked Then
Filter &= "客户地址 like '%" & .Value & "%'"
Else
Filter &= "客户地址= '" & .Value & "'"
End If
End If
End With
With e.Form.Controls("kehuleibieComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter &= "客户类别= '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("客户资料").Filter = Filter
End If
这段代码哪错了运行后(我是手机号是模糊查询、再加上性别)性别怎么不筛选呀
此主题相关图片如下:4566666.png