Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing Text Boxes on a User Form

Status
Not open for further replies.

Stevo911

Technical User
Apr 26, 2005
33
0
0
ZA
Hi everyone

I am using Microsoft Office (2003) and i've created a userform that allows the user to input values into text boxes which are later populated onto a spreadsheet.

My problem is that i am struggling to clear all the textboxes afterwards (there are many of them). I've tried this code:

Code:
Dim cCont As Control

    For Each cCont In Me.Controls
        If TypeName(cCont) = "TextBox" Then
            
             '#####
             cCont.value = "" (THIS DOES NOT WORK)

        End If
    Next cCont

The command under the line with the hashes does not work.
Any help would be greatly appreciated.

Thank you
Steve

 
try:

cCont.TEXT = ""

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top