Hi,
I have created a multipage userform for a Word [2003] document. One of the pages has numerous checkboxes. For each checkbox, there is a corresponding page/tab that will become visible when set to True.
My issue is trying to create Previous/Next commands so the user can easily move from one page/tab to the next. I can get Previous/Next to work just fine if all of the pages are visible. The problem is when there are invisible pages (the user did Not check one, or more, of the checkboxes).
Here's the code I have for the spin buttons:
Private Sub spinButton_SpinDown()
myIndex = Me.MultiPage1.SelectedItem.Index
Me.MultiPage1.Value = myIndex - 1
End Sub
Private Sub spinButton_SpinUp()
myIndex = Me.MultiPage1.SelectedItem.Index
Me.MultiPage1.Value = myIndex + 1
End Sub
So, the code reads what the current page's Index is and increments (or decreases) it by 1. That's great if the page with Index 5 is visible. However, if the Index goes from 4 right to 6, the button doesn't work.
How can I loop through the multipage control and collect an array of the pages indexes? And how do I get the buttons move from page one to the other regardless of invisibility?
Thank you in advance! I am stumped!
I have created a multipage userform for a Word [2003] document. One of the pages has numerous checkboxes. For each checkbox, there is a corresponding page/tab that will become visible when set to True.
My issue is trying to create Previous/Next commands so the user can easily move from one page/tab to the next. I can get Previous/Next to work just fine if all of the pages are visible. The problem is when there are invisible pages (the user did Not check one, or more, of the checkboxes).
Here's the code I have for the spin buttons:
Private Sub spinButton_SpinDown()
myIndex = Me.MultiPage1.SelectedItem.Index
Me.MultiPage1.Value = myIndex - 1
End Sub
Private Sub spinButton_SpinUp()
myIndex = Me.MultiPage1.SelectedItem.Index
Me.MultiPage1.Value = myIndex + 1
End Sub
So, the code reads what the current page's Index is and increments (or decreases) it by 1. That's great if the page with Index 5 is visible. However, if the Index goes from 4 right to 6, the button doesn't work.
How can I loop through the multipage control and collect an array of the pages indexes? And how do I get the buttons move from page one to the other regardless of invisibility?
Thank you in advance! I am stumped!