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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble clearing all textboxes.

Status
Not open for further replies.

iannuzzelli

Programmer
Jan 4, 2003
36
US

I am using this code:

Dim X As Control
For Each X In Me.Controls
If TypeOf X Is TextBox Then
X.Text = ""
End If

for some reason only the controls on the 1st level of the form are cleared. For example All textboxes contained on Tabcontrols and Groupboxes are not cleared. I need to specify each control and look for other controls on that control.

Any Ideas?
 
If it is in an array use

For i=Ctrl.Lbound to Ctrl.Ubound
Ctrl(i).Text=""
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top