-
FOR EACH
I'm trying to loop through all the text boxes on my form and clear the text property. Here is my code that gets an error. What am I doing wrong?
Dim l_text As TextBox
Dim l_form as frmPCReview 'frmPCReview is the name of my form with the controls
For Each l_text In l_form.Controls
l_text.text = ""
Next
Thanks,
Darin
[email protected]
-
Re: FOR EACH
Try this:
private Sub Command1_Click()
for Each Control In me
If TypeOf Control is TextBox then Control.Text = ""
next
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Re: FOR EACH
Try the following with little changes in your code
Dim l_text as control
Dim l_form as frmPCReview 'frmPCReview is the name of my form with the controls
for Each l_text In l_form.Controls
if typeof I_text is textbox then
l_text.text = ""
end if
next