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!

textboxs 1

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
I need to preform the same process on many text boxes. is there a way of setting up a loop to process them instead of selecting each one in turn then performing the action I need to do.

It would shorten my code heaps if someone could show me the light
 

Check out this thread... someone asked a similar question about combo boxes...

thread707-227108
 
You could use the following to go through all controls and apply your processing if they are TextBoxes.
Code:
    Dim ctrl As Control
    For Each ctrl In Me.Controls
        If TypeName(ctrl) = "TextBox" Then
            ' Procees the textbox here
        End If
    Next

AC
 
Thanks Acron

That did the job I hope the star serves you well
 

Yeah, thanks Acron. The method I suggested in the other thread works... but it's a messy workaround.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top