I found a blog that describes something I want to do but there seems to be a problem with a couple lines in the code provided. The blog is here:
https://www.microsoft.com/en-us/micr...h-as-you-type/
I changed text color of the offending lines of code to red.
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 = “[Company] = ‘” & _
Replace(Me.cboFilter.Text, “‘”, “””) & “‘”
Me.FilterOn = True
' If a partial value is typed, filter for a partial company name match.
Else
Me.Form.Filter = “[Company] 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
Thank you very much!