I've created a multipage userform to collect some data and am puzzled over the back button I have created and why it does not work as i would like. Basically as the user progresses through the form some of the pages on the userform are disabled according to their answers to previous questions. For example:
QuoteIf Var1.Value = True Then
MultiPage1(13).Enabled = True
Else
MultiPage1(13).Enabled = False
End if
If Var1.Value = true then the userform has no trouble in skipping page 13 and going straight on to page 14 when I click the next button. However if I try and click the back button nothing happens. Here is my code for the back and next buttons:
QuoteDisplay MorePrivate Sub BackButton_Click()
MultiPage1.Value = MultiPage1.Value - 1
UpdateControls
End SubPrivate Sub NextButton_Click()
MultiPage1.Value = MultiPage1.Value + 1
UpdateControls
End Sub
I understand that the userform will not skip back from Multipage 14 to Multipage 12 as the back button is saying Multipage1.Value = MultiPage1.Value - 1 (i.e. multipage 13), but why then does it skip from Multipage 12 to 14 when I click the next button? Is there a way I can get my back button to skip back to the last enabled page?
thanks for your help.