I have a "Clear" button on a search form that only clears the search fields on the main form. I would like it to also clear the query results I have as a subform on this form and return it to it's original state.
What do I need to change?
The search form is used to look up medical names and codes based upon five categories: Disease, Etiology, Morphology, Procedure & Topography. The search fields can be used singly or have entries in each field and the query updates to find your search parameters. It works except for my clear button.
Tables:
tblCategory
tblSNOMED
Forms:
frmSearch - Main form
qrySearchsubform - subform
Queries:
qrySearch - query
Here is the code:
Private Sub SearchButton_Click()
Me.qrySearchsubform.Requery
End Sub
Private Sub ClearButton_Click()
Dim Ctl As Control
On Error Resume Next
For Each Ctl In Me.Controls
Ctl.Value = Null
Next Ctl
End Sub