Hi Everyone,
I'm currently trying to put 3 dropdowns on a form that will allow me to filter the table behind it but i keep getting error 3075.
This is the code i'm using.
it keeps hanging on the 8th linbe up - Me.Filter = strFilter
any help you guys can give will be thankfully received.
Wayne
I'm currently trying to put 3 dropdowns on a form that will allow me to filter the table behind it but i keep getting error 3075.
This is the code i'm using.
Code:
Private Sub cmd_filter_Click()
Dim strFilter As String
Dim strConj As String
strConj = " AND " ' could be " OR "
With Me.cbo_wardfilter
If Not IsNull(.Value) Then
strFilter = strFilter & strConj & _
"(Ward = '" & .Value & "')"
End If
End With
With Me.cbo_agefilter
If Not IsNull(.Value) Then
strFilter = strFilter & strConj & _
"(Age Range = '" & .Value & "')"
End If
End With
With Me.cbo_sex
If Not IsNull(.Value) Then
strFilter = strFilter & strConj & _
"(Gender = '" & .Value & "')"
End If
End With
If Len(strFilter) > 0 Then
' Trim off leading conjunction, if any, then apply the filter.
strFilter = Mid$(strFilter, Len(strConj) + 1)
Me.Filter = strFilter
Me.FilterOn = True
Else
' Remove any filter that may be active.
Me.FilterOn = False
Me.Filter = vbNullString
End If
End Sub
it keeps hanging on the 8th linbe up - Me.Filter = strFilter
any help you guys can give will be thankfully received.
Wayne