Private Sub Form_Load() clearText End SubPrivate Sub clearText() Dim t As TextBox For Each t In Me.Controls t.Text = "" Next End Sub
Public Sub ClearAllTextBox(frm As Form) Dim c As Object For Each c In frm If TypeOf c Is TextBox Then c.Text = vbNullString End If NextEnd Sub
Sub Cleratext() Dim txt As Object For Each txt In Me.Controls If TypeOf txt Is TextBox Then txt = "" Next End SubPrivate Sub Command1_Click() Cleratext End Sub
clearText
End SubPrivate Sub clearText()
Dim t As TextBox
For Each t In Me.Controls
t.Text = ""
Next
End Sub
For Each c In frm
If TypeOf c Is TextBox Then
c.Text = vbNullString
End If
NextEnd Sub
Dim txt As Object
For Each txt In Me.Controls
If TypeOf txt Is TextBox Then txt = ""
Next
End SubPrivate Sub Command1_Click()
Cleratext
End Sub