VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Clear all text boxes on a form with 6 lines of code.

by karada (6 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 8th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Clear all text boxes on a form with 6 lines of code.

Rate Clear all text boxes on a form with 6 lines of code.



'Add a command button and put the code...

Private Sub Command1_Click()
Dim ctr As Control
For Each ctrl In Me.Controls
    If TypeOf ctrl Is TextBox Then
        ctrl.Text = ""
    End If
Next
End Sub

Download this snippet    Add to My Saved Code

Clear all text boxes on a form with 6 lines of code. Comments

No comments have been posted about Clear all text boxes on a form with 6 lines of code.. Why not be the first to post a comment about Clear all text boxes on a form with 6 lines of code..

Post your comment

Subject:
Message:
0/1000 characters