0
strFilter的結果如下,但不會貫徹到Me.Filter中,爲什麼?
strFilter的= 「 '20410' OR 'A20000' OR 'A20400'」多場過濾要求
Private Sub Image_OffsetFilterButton_Click()
Dim strFilter As String
strFilter = "'A20410'"
'/ see if there is data in Field Box Text907, if so add it to the filter
If Me!Text907 & vbNullStr <> vbNullStr Then
strFilter = strFilter & " OR " & "'" & "A20000" & "'"
End If
If Me!Text910 & vbNullStr <> vbNullStr Then
' If FieldB is of Text type, use the ' delimiter
strFilter = strFilter & " OR " & "'" & "A20024" & "'"
End If
If Me!Text911 & vbNullStr <> vbNullStr Then
' If FieldB is of Text type, use the ' delimiter
strFilter = strFilter & " OR " & "'" & "A20400" & "'"
End If
'/<etc>
If strFilter <> "" Then
' trim off leading "OR"
Me.Filter = "[Account] = strFilter AND [BU] = 'B50931'"
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
結束子