Using Access 2003;
I'm trying to filter a simple continuous form using selections from various combo boxes.
It is not using any sub-forms.
Using the below code I am getting run time error '2001' when any one of the combo boxes doesn't equal "All".
I'm aware that this error is to do with the parenthesis or syntax of "strFilter", but after spending days of searching the internet and forums, and making every combination of Me. Me! [ """ "'" etc... I simply can't get it to work.
My Code;
Any help would be greatly appreciated, I'm sure it's a simple solution!
Thanks in advance,
Troy
I'm trying to filter a simple continuous form using selections from various combo boxes.
It is not using any sub-forms.
Using the below code I am getting run time error '2001' when any one of the combo boxes doesn't equal "All".
I'm aware that this error is to do with the parenthesis or syntax of "strFilter", but after spending days of searching the internet and forums, and making every combination of Me. Me! [ """ "'" etc... I simply can't get it to work.
My Code;
Code:
Private Sub ApplyFilter_Click()
Dim strFilter As String
strFilter = "1=1"
If Me.QuotedFilter <> "All" Then
strFilter = strFilter & " AND [Quoted]='" & Me!QuotedFilter & "'"
End If
If Me.AcceptedFilter <> "All" Then
strFilter = strFilter & " AND [Accepted]='" & Me!AcceptedFilter & "'"
End If
If Me.CompletedFilter <> "All" Then
strFilter = strFilter & " AND [Completed]='" & Me!CompletedFilter & "'"
End If
Me.Filter = strFilter
Me.FilterOn = True
End Sub
Any help would be greatly appreciated, I'm sure it's a simple solution!
Thanks in advance,
Troy