Multipage (wizard)

T

Topher

I am creating a 'wizard' type user form using multiforms. What I would like
to do is ask a question and then depending on the answer go to the next
appropriate page on the multiform. Example:

Is it Red? (option button)
Is it Blue? (option button)

When pressing the next button, if the OB for red is chosen go to page 3, if
OB for blue then go to page 4, if not OB chosen then msg 'you must choose'
 
P

Patrick Molloy

Private Sub OptionButton1_Click()
MultiPage1.Value = 2
End Sub

Private Sub OptionButton2_Click()
MultiPage1.Value = 3
End Sub
 
T

Topher

Thanks Patrick but I don't want the users use of the OB to be the 'trigger'
but the use of a 'Next' button as there is addtional info on the page.
 
P

Patrick Molloy

Option Explicit

Private Sub CommandButton1_Click()
If OptionButton1 Then
MultiPage1.Value = 2
ElseIf OptionButton2 Then
MultiPage1.Value = 3
Else
MsgBox "Please select an option"
End If
End Sub
 
P

Patrick Molloy

OR

Option Explicit
Private Sub CommandButton1_Click()
Select Case True
Case OptionButton1
MultiPage1.Value = 2
Case OptionButton2
MultiPage1.Value = 3
Case Else
MsgBox "Please select an option"
End Select
End Sub
 
T

Topher

How do I loop this until one of the OBs is selected or the Cancel button is
pressed?
 
P

Patrick Molloy

you don't need to loop. once the user clicks an option they need to press
NEXT again. Nothing happens when they click NEXT unless one of the options is
true
OR do what my first code did and go to one of the pages as soon as they
select the option.
 

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