ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ?? MultiPage Cancel/Next/Previous/Finish Command Buttons ?? (https://www.excelbanter.com/excel-programming/330277-multipage-cancel-next-previous-finish-command-buttons.html)

[email protected]

?? MultiPage Cancel/Next/Previous/Finish Command Buttons ??
 
What is the best way of doing this and how.
This is what I want....
MultiPage1.Value =0 Cancel Next
MultiPage1.Value =1 Previous Next
MultiPage1.Value =2 Previous Finish

Is it best to create one of each and then make then visible/invisible
for each tab ( and how do you do this)

Or is it best to generate each one on each tab seperately. If so, can
you then group all the Nexts together to write one sub that will move
to the next page rather than having to generage duplicate subs for each
button.

Both the above ways I have tried but stumble on both. 1st option I
can't get the right syntax to make visible/invisible which I am trying
to do under the MultiPage1_Change() which apparently isn't valid.
2nd option I can make a new collection of the next buttons but then
don't know how to use that group to attach to code to raise the tab
number.

Can anybody help ? Thanking you in advance.


Bob Phillips[_7_]

?? MultiPage Cancel/Next/Previous/Finish Command Buttons ??
 
I would create 4 buttons,not on the multipage, but on the form, overlaying
Cancel and previous, and also Next and Finish and hide and unhide them as
each page is activated.

Like this

Private Sub MultiPage1_Change()
If Me.MultiPage1.Value = 0 Then
Me.cmdCancel.Visible = True
Me.cmdPrevious.Visible = False
Me.cmdNext.Visible = True
Me.cmdFinish.Visible = False
ElseIf Me.MultiPage1.Value = 1 Then
Me.cmdCancel.Visible = False
Me.cmdPrevious.Visible = True
Me.cmdNext.Visible = False
Me.cmdFinish.Visible = True
End If
End Sub

Private Sub UserForm_Activate()
Me.cmdCancel.Visible = True
Me.cmdPrevious.Visible = False
Me.cmdNext.Visible = True
Me.cmdFinish.Visible = False
End Sub


--
HTH

Bob Phillips

wrote in message
oups.com...
What is the best way of doing this and how.
This is what I want....
MultiPage1.Value =0 Cancel Next
MultiPage1.Value =1 Previous Next
MultiPage1.Value =2 Previous Finish

Is it best to create one of each and then make then visible/invisible
for each tab ( and how do you do this)

Or is it best to generate each one on each tab seperately. If so, can
you then group all the Nexts together to write one sub that will move
to the next page rather than having to generage duplicate subs for each
button.

Both the above ways I have tried but stumble on both. 1st option I
can't get the right syntax to make visible/invisible which I am trying
to do under the MultiPage1_Change() which apparently isn't valid.
2nd option I can make a new collection of the next buttons but then
don't know how to use that group to attach to code to raise the tab
number.

Can anybody help ? Thanking you in advance.




[email protected]

?? MultiPage Cancel/Next/Previous/Finish Command Buttons ??
 
Thanks for the reply Bob.
That works a treat but I have to change tabs on the multichange for it
to change to what should be showing, so taking a logical guess I have
to set set state of the multipage (ie tab1) and the state of which
buttons I want visible before I show the userform...correct ?
and do I do this using a ....
Private Sub UserForm_Initialize()

One last thing.....can you explain what the ' Me ' is. I've seen it a
lot and to be honest have never done a search in this forum on ' Me ' .
Thanks for your help.


Bob Phillips[_7_]

?? MultiPage Cancel/Next/Previous/Finish Command Buttons ??
 
Yes, but I gave you that although I did it in the Activate event, not
Initialize, but both work.

--
HTH

Bob Phillips

wrote in message
oups.com...
Thanks for the reply Bob.
That works a treat but I have to change tabs on the multichange for it
to change to what should be showing, so taking a logical guess I have
to set set state of the multipage (ie tab1) and the state of which
buttons I want visible before I show the userform...correct ?
and do I do this using a ....
Private Sub UserForm_Initialize()

One last thing.....can you explain what the ' Me ' is. I've seen it a
lot and to be honest have never done a search in this forum on ' Me ' .
Thanks for your help.





All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com