Does any one know how i could erase all of the contents of my text boxes in my application?
If text1.text = visible then
erase text1.text '?????????????????
I have no idea how to accomplish this task.
Thanxxxxxx =C)
Printable View
Does any one know how i could erase all of the contents of my text boxes in my application?
If text1.text = visible then
erase text1.text '?????????????????
I have no idea how to accomplish this task.
Thanxxxxxx =C)
Here try this
If text1.text = visible Then
text1.text = ""
End if
Declare a variable as a Control, and loop through all the controls on your form. If the type of control is a textbox, set it's caption to an empty string.
Here's an example:
Put a command button named Command1 on your form, and as many textboxes as you want. Then paste the following code into your form's code window.
When you run the project, type text into all the textboxes. Then click the command button to clear them all.
Code:Option Explicit
Private Sub Command1_Click()
Dim Ctrl As Control
For Each Ctrl In Me.Controls
If TypeOf Ctrl Is TextBox Then
Ctrl.Text = ""
End If
Next Ctrl
End Sub