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

Control.TabIndex

Status
Not open for further replies.

TheRealDeal

Technical User
Joined
Nov 16, 2001
Messages
187
Location
US
Is it possible to iterate through a Forms controls by use of the For Each statement using the control's tabindex?

Something like:
Dim ctlIndex As Control.Index

' Some process
For Each ctlIndex In Me.Controls.Index
...
Next
 
nope, you can't use the tabindex as it's not a collection of objects (as far as I know)

however you can loop through all controls on a form using the controls collection...

dim ctl as variant
for each ctl in forms("frmName").controls
'do stuff
next ctl

this helps if you either prefix or suffix your relevant control names, because then you can test the names to see if they fit the parameter...

e.g. naming all text boxes with "tbx"+"actualName"

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top