-
Error in Module
Hi,
I created a Fuction in the module in order to clear all textboxes in a form.
The clear button does work but it still displays an error at the bottom saying :
Expression is of type ........., which is not a collection type.
Can anyone help me with this ?
Thanks
-
Re: Error in Module
Not without seeing what you did, what you've tried, the error line in question, etc. If you want help, use CODE TAGS and post your code.
-
Re: Error in Module
Code:
Private Sub ClearTextControls()
Dim ctl As Control
For Each ctl In Form1 ' loop all controls on Form1
If TypeOf ctl Is TextBox Then ' If the control is a TextBox
ctl.Text = vbNullString ' set its value to null
End If
Next ctl
End Sub