|
-
Oct 19th, 2005, 05:19 AM
#1
Thread Starter
Junior Member
Dynamically blank all text controls on a form
Hi,
I'd like to know is it possible to do something like the following
VB Code:
For each objcontrol in form.controls
if objcontrol is a textbox
objcontrol.text = ""
end if
Next
Is this possible
-
Oct 19th, 2005, 05:24 AM
#2
Re: Dynamically blank all text controls on a form
Moved from CodeBank.
This is how you would code it:
VB Code:
Dim ctrl As Control
For ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then
ctrl.text = vbNullString
End If
Next
-
Oct 19th, 2005, 05:41 AM
#3
Thread Starter
Junior Member
Re: Dynamically blank all text controls on a form
Thanks Hack,
I just realised I had posted it in the wrong place. Was browsing through the codebank and hit new thread from there Typeof was the keyword I was looking for
Cheers
-
Oct 19th, 2005, 06:04 AM
#4
Re: Dynamically blank all text controls on a form
 Originally Posted by simonhorne
I just realised I had posted it in the wrong place. Was browsing through the codebank and hit new thread from there
Happens all the time.
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
|