老师,有这个报错
此主题相关图片如下:微信截图_20190827154325.png
Dim area As String = "0-90,110-120" '面积
Dim area1 As String = "101" '区域1
Dim area2 As String = "10101" '区域2
Dim total As String = "0-90,110-120" '价格
Dim shape As String = "0-1,1-2,2-3" '房型
Dim houseage As String = "1-2" '房龄
Dim Filter As String
If area1 > "" Then
Filter = "一级区域 = '" & area1 & "'"
End If
If area2 > "" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "二级区域 = '" & area2 & "'"
End If
If area > "" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Dim Values() As String
Values = area.split(",")
Dim f2 As String = " ( 1=2 "
For Each s As String In Values
f2 = f2 & " or 面积 BETWEEN " & s.Replace("-"," and ")
Next
Filter = Filter & f2 & " ) "
End If
If total > "" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Dim Values() As String
Values = total.split(",")
Dim f2 As String = " ( 1=2 "
For Each s As String In Values
f2 = f2 & " or 售价 BETWEEN " & s.Replace("-"," and ")
Next
Filter = Filter & f2 & " ) "
End If
If shape > "" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Dim Values() As String
Values = shape.split(",")
Dim f2 As String = " ( 1=2 "
For Each s As String In Values
f2 = f2 & " or 室 BETWEEN " & s.Replace("-"," and ")
Next
Filter = Filter & f2 & " ) "
End If
If houseage > "" Then
If Filter > "" Then
Filter = Filter & " And "
End If
Dim Values() As String
Values = houseage.split(",")
Dim f2 As String = " ( 1=2 "
For Each s As String In Values
f2 = f2 & " or 房龄 BETWEEN " & s.Replace("-"," and ")
Next
Filter = Filter & f2 & " ) "
End If
output.Show(filter)
Tables("房产信息").Filter = Filter