Dim Filter As String
Dim shmcmhcz As WinForm.CheckBox = e.Form.Controls("shanghumohuchazhaoCheckBox")
With e.Form.Controls("shanghumingchengTextBox")
If .Value IsNot Nothing Then
If shmcmhcz.Checked Then
Filter = "商户名称 like \'%" & .Value & "%\'"
Else
Filter = "商户名称= \'" & .Value & "\'"
End If
End If
End With
Dim frxmmhcz As WinForm.CheckBox = e.Form.Controls("farenmohuchazhaoCheckBox")
With e.Form.Controls("farenxingmingTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If frxmmhcz.Checked Then
Filter = "法人姓名 like \'%" & .Value & "%\'"
Else
Filter = "法人姓名= \'" & .Value & "\'"
End If
End If
End With
Dim jjtmmhcz As WinForm.CheckBox = e.Form.Controls("jijumohuchazhaoCheckBox")
With e.Form.Controls("jijutiaomaTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If jjtmmhcz.Checked Then
Filter = "机具条码 like \'%" & .Value & "%\'"
Else
Filter = "机具条码= \'" & .Value & "\'"
End If
End If
End With
Dim llkmhcz As WinForm.CheckBox = e.Form.Controls("liuliangkamohuchazhaoCheckBox")
With e.Form.Controls("liuliangkahaoTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If llkmhcz.Checked Then
Filter = "流量卡号 like \'%" & .Value & "%\'"
Else
Filter = "流量卡号= \'" & .Value & "\'"
End If
End If
End With
With e.Form.Controls("tongdaomingchengComboBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = "通道名称= \'" & .Value & "\'"
End If
End With
Dim shbhmhcz As WinForm.CheckBox = e.Form.Controls("shanghubhmohuchazhaoCheckBox")
With e.Form.Controls("shanghubianhaoTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If shbhmhcz.Checked Then
Filter = "商户编号 like \'%" & .Value & "%\'"
Else
Filter = "商户编号= \'" & .Value & "\'"
End If
End If
End With
Dim wdbhmhcz As WinForm.CheckBox = e.Form.Controls("wangdianbhmohuchazhaoCheckBox")
With e.Form.Controls("wangdianbianhaoTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If wdbhmhcz.Checked Then
Filter = "网点编号 like \'%" & .Value & "%\'"
Else
Filter = "网点编号= \'" & .Value & "\'"
End If
End If
End With
Dim wdmcmhcz As WinForm.CheckBox = e.Form.Controls("wangdianmcmohuchazhaoCheckBox")
With e.Form.Controls("wangdianmingchengTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If wdmcmhcz.Checked Then
Filter = "网点名称 like \'%" & .Value & "%\'"
Else
Filter = "网点名称= \'" & .Value & "\'"
End If
End If
End With
Dim wddzmhcz As WinForm.CheckBox = e.Form.Controls("wangdiandzmohuchazhaoCheckBox")
With e.Form.Controls("wangdiandizhiTextBox")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If wddzmhcz.Checked Then
Filter = "网点地址 like \'%" & .Value & "%\'"
Else
Filter = "网点地址= \'" & .Value & "\'"
End If
End If
End With
With e.Form.Controls("shanghuzhuangtaiComboBox")
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
Forms("商户资料查询窗体").Close
老师这段代码那错了,怎么运行后查询的结果和实际不一样呀?
单项查可以,联合查就把所有的数据都查出来了