TextBoxes are just like any other Objects on a form, could be cleared or we can say "Make it empty" .
so if we have :
Textbox1 and Textbox2 and Textbox3 on a form and we have a button called "CmdNew" and its function is to clear all the writings in all of the 3 TextBoxes .... we can do something like that :-
Private Sub Cmd_New_Click()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Or .........
General Declarations
Dim TxtBx as Control
Public Sub ClearAllTxtBxs()
For each TxtBx in Me.Controls
If TypeOf TxtBx Is TextBox Then
TxtBx.Text = ""
End If
Next TxtBx
End Sub
Private Sub Cmd_New_Click()
ClearAllTxtBxs()
End Sub
Now ........
What if we have ComboBoxes Too ?
Or .........
What if we have various objects that we wanna set thier values to anything .... ??
- if you understood the previous example i think you already knew the answer ....
Good Luck