Clear button on form not wroking properly

gojets1721

Registered User.
Local time
Yesterday, 23:49
Joined
Jun 11, 2019
Messages
430
I've got a form that I use to filter a report. I have clear button so that the user can press it and it resets the fields to remove all the info in there in order to do a new search. The button clears the fields fine, however after you clear it, input new content into the fields and search, the report comes back completely empty. Not sure what is wrong. The 'clear button' code is below:

Code:
Private Sub btnClearForm_Click()
    Me.txtStartDate.Value = ""
    Me.txtEndDate.Value = ""
    Me.txtCustomerID.Value = ""
    Me.txtEmployee.Value = ""
    Me.ComboLocation.Value = ""
    Me.ComboCategory.Value = ""
    Me.ComboSubCategory.Value = ""
    Me.Requery
End Sub
 
Hi. Are you using a bound form to filter a report? Can you show us the code to actually filter the report? Maybe you're clearing the form but not the report.
 
Also, all values should be set to null not empty strings.
 

Users who are viewing this thread

Back
Top Bottom