Clearing of a form

opostal

Registered User.
Local time
Yesterday, 18:31
Joined
Jun 26, 2009
Messages
47
I have a form that has 19 combo boxes which are linked to queries from a table. My intent is that the user should choose the applicable items from the drop down boxes on this first form, then hit a search button at the bottom which opens a new form that is filtered by the data from the first form. The user can then close the new "filtered" form and return to the original one by hitting the "close form" button I have placed on the new form.

Once returning to the first form for selection, I would like to place a new button on that form to "clear" all of the combo boxes. I seem to be failing at accomplishing that goal and was wondering if I could get a suggestion or two as to how I might accomplish this?
 
One method:

Code:
  Dim ctl As Control

  For Each ctl In Me.Controls 
    Select Case ctl.ControlType
      Case acComboBox
        ctl = Null
    End Select
  Next ctl

You could also use the tag property of the controls and test for that:

Code:
If ctl.Tag = "Clear" Then
  ctl = Null
End If
 
I am still working with your suggestion. I seem to be struggling a bit but am not even close to done yet so will get back to you as soon as I have progression. Thank you for your input however.
 

Users who are viewing this thread

Back
Top Bottom