I still cant get the filter to filter the results, in the combo box it does show all the first names, however it doesn't filter them, I am using a query called View contacts in the subform. The main form is called Contacts and the subform is called View_Contacts subform. This is the code I am using:
Code:
Private Sub cboFilter_Change() ' If the combo box is cleared, clear the form filter.
If Nz(Me.cboFilter.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
' If a combo box item is selected, filter for an exact match.
' Use the ListIndex property to check if the value is an item in the list.
ElseIf Me.cboFilter.ListIndex <> -1 Then
Me.Form.Filter = "[FirstName] = '" & _
Replace(Me.cboFilter.Text, "'", "''") & "'"
Me.FilterOn = True
' If a partial value is typed, filter for a partial company name match.
Else
Me.Form.Filter = "[FirstName] Like '*" & _
Replace(Me.cboFilter.Text, "'", "''") & "*'"
Me.FilterOn = True
End If
' Move the cursor to the end of the combo box.
Me.cboFilter.SetFocus
Me.cboFilter.SelStart = Len(Me.cboFilter.Text)
End Sub
This is what I get when I open the form
As you can see it doesn't only show Anna
Thank you again.