Frame Index
Here is a situation : I have a form with multipage control (Multipage has 6 pages). On each page i have 2 frames. I want to access the frames (through code) in a sequence (for eg : page1.frame1 and then page1.frame2 and then page2.frame2.page1 and so on.........). I am using the below code and what happens is that it picks the sequence as frames were created..(for eg you created a frame on page 2 and then you went back and created another frame on frame 1...it takes the the frame created on page 2 first and then the frame created on page 1) but i want the other way around. I went and looked into properties to set the index but that does'nt work.
Help will be appreciated...
Code
Private Sub CommandButton1_Click()
Dim ctrl As Control
Dim msg As String
For Each ctrl In UserForm1.Controls
If LCase(Mid(ctrl.Name, 1, 3)) = "fra" Then
msg = msg & vbNewLine & ctrl.Name
End If
Next ctrl
MsgBox msg
End Sub
Ajitpal S Padda
__________________
Ajitpal S Padda
|