MultiPage tomfoolery

C

CrankyLemming

Hi

I've created a userform which contains a multipage with 7 pages, one
of which is called 'Employment'. Elsewhere on the form I have a
combobox with Yes/No options. Is there a way I can temporarily
hide/remove the 'Employment' page on the multipage if the combobox is
set to 'No' (IE leaving a 6-page multipage)?

Thanks in advance

Steve
 
D

Dave Peterson

Have you thought of using a Checkbox instead of the combobox?

As a user, I think I'd find that easier to work with:

Option Explicit
Private Sub CheckBox1_Click()
Me.MultiPage1.Pages("page6").Visible = CBool((Not Me.CheckBox1.Value))
End Sub


I used the (Name) of the sheet--not the caption.

or:

Option Explicit
Private Sub ComboBox1_Change()
Me.MultiPage1.Pages("page6").Visible _
= CBool(LCase(Me.ComboBox1.Value) = "yes")
End Sub
Private Sub UserForm_Initialize()
With Me.ComboBox1
.Clear
.AddItem "Yes"
.AddItem "No"
End With
End Sub
 

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