Hi,
When we loop through controls collection
(For ...each)is it possible to loop through the ctrls in same order as taborder if yes how .Because in my case looping is starting from some random point.
Thanx
Murali
Printable View
Hi,
When we loop through controls collection
(For ...each)is it possible to loop through the ctrls in same order as taborder if yes how .Because in my case looping is starting from some random point.
Thanx
Murali
Hi Murali.
Here's a way to loop through the controls in Tab Order.
For each control on your Form, set the Tag property to the same value of the Taborder. Place a command button on the Form and put this code in the VB Editor:All the best.Code:Option Explicit
Private Sub Command1_Click()
Dim iCounter As Integer
For iCounter = Form1.Controls.Count - 1 To 0 Step -1
MsgBox "Control: " & Form1.Controls(iCounter).Name & vbCrLf & _
"Tag: " & Form1.Controls(iCounter).Tag
Next
End Sub
------------------
OneSource
.Quote:
The truth may be out there, but it's in here too!