This SQL coding works just great, I an mow using it everywhere. The only problem I have is that when I click on the 'Clear' button, set up exactly as in your video, all the search fields clear, but the docmd.ShowAllRecords does not show all the records again.
The form is stuck on your last filter. You can refilter, works just fine, but the only way to show all the records again is to close and open the form. there must be something that is not clearing?
Yes, sorry should have checked there first, so it must be something in my coding! I noticed in the template that each search field had an AfterUpdate Requery event, which I have added, but still not showing all records after a filter has been applied?
In the Status text box this remains after clearing the filters: SELECT * FROM q1PupilList WHERE txtSurname LIKE "*sm*" ORDER BY txtSurname
Tony RobertsOP
@Reply 5 years ago
Got it! Me.RecordSource was in in the clear sub
Private Sub btnClear_Click()
StatusFilter = ""
PupilCodefilter = ""
Surnamefilter = ""
PreNameFilter = ""
CAT1Filter = ""
CAT2Filter = ""
HouseFilter = ""
AdmissionFilter = ""
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Search Seminar.