|
-
November 4th, 1999, 03:48 PM
#1
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]
-
November 4th, 1999, 04:05 PM
#2
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]
-
November 4th, 1999, 11:45 PM
#3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|