Well most of my databases have such a field. Its not easy material but i think you can copy it to suit your needs.
I punt my code behind the afterupdate of the textfield :
Code:
Private Sub YourUnitNumberField_AfterUpdate()
FilterForm
End Sub
Then put the filterform code in the VBA of your form like this :
Code:
Private Sub FilterForm()
Dim strFilter As String
Dim blnFilter As Boolean
blnFilter = False
strFilter = " 1=1 "
If Me.YourUnitNumberField <> "" Then
strFilter = strFilter + " and UnitNumber like '*" & YourUnitNumberField & "*'"
blnFilter = True
End If If blnFilter Then
Me.Filter = strFilter
Else
Me.Filter = "1=2"
End If
Me.FilterOn = True
End Sub
I presumed UnitNumber is the field in your table, and YourUnitNumberField is the name of the textbox your searching with.
Edit these to fit your own table field and form field.
Let me know if it works for you
Greetings, Jeroen