PDA

View Full Version : Multipage Userform - Navigating between pages/tabs



lbb4ever
03-02-2010, 10:39 AM
Hi,

I have created a multipage userform for a Word [2003] document. One of the pages/tabs on the multipage control 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!

lucas
03-02-2010, 10:50 AM
Please post the document after taking any personal or real business info out of it.

click on go advanced and then scroll down, look for a button that says manage attachments.

fumei
03-02-2010, 01:39 PM
You have crossed posted this to Tek-Tips. I have fully answered there.

lucas
03-02-2010, 04:01 PM
lbb4ever, please read this before posting (http://www.excelguru.ca/node/7).