Does any body know how i can clear out all of the contents of my text boxes in my application?
If text1.text = visible then
clear text1.text '???????????????
I really have no idea how to accomplish this task
Thanks =C)
Printable View
Does any body know how i can clear out all of the contents of my text boxes in my application?
If text1.text = visible then
clear text1.text '???????????????
I really have no idea how to accomplish this task
Thanks =C)
When I need to do this I make sure all my text boxes have the same tag. eg 'TextBox'
Then you could do something like :
dim ctl as control
for each ctl in me
if ctl.tag = "TextBox" then ctl.Text = ""
next ctl
You have to trap the error which occurs when a control without a tag property is checked. Sorry can't remember it off hand, as all my VB stuff is at work.
Hope this helps. :)
Thanks Steve,
I see what you mean by setting all of the tags to something to like textbox. This way i guess you can use
a For Each - Next loop to to repeat a group of statements for each element in a collection of objects. Did i say that Right??? {{{laughing}}} but i still have to figure out the group part in the , For Each (element) In Group. Group would be the????????
Thanks again.
Thanks Steve,
I see what you mean by setting all of the tags to something to like textbox. This way i guess you can use
a For Each - Next loop to to repeat a group of statements for each element in a collection of objects. Did i say that Right??? {{{laughing}}} but i still have to figure out the group part in the , For Each (element) In Group. Group would be the????????
Thanks again.
Hello,
Here you go a little piece of code which should help you,
Hope it helps,Code:Dim obj As Object
For Each obj In Me.Controls
If TypeOf obj Is TextBox Then
obj.Text = ""
End If
Next
Desire.