I have used the examples from previous messages about creating a cascading combobox and they have work really well for me. Now I would like to take it one step further.
I have my first cbobox which allows me to pare down to the list I will select for my second cbobox. Based on my two selections I do a query to populate some view only text boxes giving descriptions of the product, etc.
What I want to do is when I make a new selection from my first cbobox, it will clear all the fields on my form. I've tried using setvalue, but it does exactly what it says it will do. It changes the values of my record.
1-I placed one Command Button on form.
2-In onClick event I called ClearAll Sub.
Private Sub command4_Click()
3-Passing the FormName by ref
Public Sub clearAll(ByRef Form As Form)
Dim ctrl As Control
For Each ctrl In Form
If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Or TypeOf ctrl Is CheckBox Then
ctrl.Value = Null