Cycle Through Specific Controls On A Form

  • Thread starter Thread starter Douglas J. Steele
  • Start date Start date
I know how to cycle through all the controls on a form with For Each Ctl in
Forms!.../Next and how to check if the control is a text box inside the loop by
checking the ControlType property. Is there a way to directly cycle through only
the textboxes on a form? Something like --
For Each Ctl acTextbox in Forms!...

Next Ctl


Thanks!

Tom
 
Tom said:
I know how to cycle through all the controls on a form with For Each Ctl in
Forms!.../Next and how to check if the control is a text box inside the loop by
checking the ControlType property. Is there a way to directly cycle through only
the textboxes on a form? Something like --
For Each Ctl acTextbox in Forms!...

Next Ctl

If you are going to be looping through the textbox controls a number of
times, you can always load the textbox controls into a collection on form
open and from then on cycle through that collection only.
 
Back
Top