Multipage form: Referencing controls on one page

G

Guest

I want to set the tabindex of the controls on only one page of a multipage
form.

I'm starting with
dim frm as msforms.userform
dim CTL as msforms.control
dim i as integer

set frm = Myform
i = 0
for each CTL in frm.controls
'I really would like to have said:

for each CTL in frm.controls on Multipage(1) '.i.e. Page 1 of the
Multipage form.
CTL.tabindex = i
i = i + 1
next

I tried VBA help, but can't seem to find the right way of referencing the
controls of a particular multipage page. I'm sure it's just a question of
syntax.

Greatly appreciated in advance
 
G

Guest

some sample code:

Private Sub CommandButton3_Click()
For Each ctl In Me.MultiPage1.Pages(0).Controls
Debug.Print ctl.Name
Next
End Sub

just remember that the first page is index zero.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top