PDA

View Full Version : Solved: use multipage as button



Djblois
02-23-2007, 08:12 AM
I am using a multipage function on my form but the last page I want to consider a button. Can I make it so when someone clicks on the last page tab (named Advanced) it runs code to bring up another form instead of switching pages?

dansam
02-23-2007, 08:25 AM
Hi Djblois,
This may be help you :
Private Sub MultiPage1_Change()
Dim n As String
n = MultiPage1.Pages.Count
If MultiPage1.Value = n - 1 Then
Unload Me
UserForm2.Show ' name of that userform which you want to show
End If
End Sub

thanks,
dan

mvidas
02-23-2007, 08:30 AM
Djblois,
Private Sub MultiPage1_Change()
With MultiPage1
If .SelectedItem.Name = .Pages(.Pages.Count - 1).Name Then
Me.Hide
UserForm2.Show
End If
End With
End SubShould do it!
Matt

mvidas
02-23-2007, 08:32 AM
Sorry Dansam, didn't refresh :)

Djblois
02-23-2007, 09:01 AM
that worked guys thank you