N
Neil
Hello, I have a continuous form with just one text box on. I have another
text box in the form header and I want this box to serve as a user filter.
Each time the user enters a key or deletes something, I want the form to
filter down the form recordsource and display only the matching data.
My code of :
If IsNothing(txtFind) Then
DoCmd.ShowAllRecords
Else
strFind = "[MaterialName] LIKE '*" & [txtFind] & "*'"
DoCmd.ApplyFilter , strFind
End If
If IsNothing([MaterialName]) Then
MsgBox "No materials match your search.", vbInformation
txtFind = vbNullString
DoCmd.ShowAllRecords
txtFind.SetFocus
End If
doesn't seem to filter, all it does is set the focus from the txtFind box to
the first record and wipe the txtFind box. In fact the key never actually
appears on the txtFind box at all.
Is there another way to do this?
Many thanks,
Neil.
text box in the form header and I want this box to serve as a user filter.
Each time the user enters a key or deletes something, I want the form to
filter down the form recordsource and display only the matching data.
My code of :
If IsNothing(txtFind) Then
DoCmd.ShowAllRecords
Else
strFind = "[MaterialName] LIKE '*" & [txtFind] & "*'"
DoCmd.ApplyFilter , strFind
End If
If IsNothing([MaterialName]) Then
MsgBox "No materials match your search.", vbInformation
txtFind = vbNullString
DoCmd.ShowAllRecords
txtFind.SetFocus
End If
doesn't seem to filter, all it does is set the focus from the txtFind box to
the first record and wipe the txtFind box. In fact the key never actually
appears on the txtFind box at all.
Is there another way to do this?
Many thanks,
Neil.