"Next" Button

R

Rob Brookbanks

I want to make a form with a series of "Next" buttons... Just the standard
thing where each next button "Walks" through the steps I intend the users to
take.

Before I start the coding, is there a good or a bad way to do it? I was
intending to have NextButton1, NextButton2 etc, all stacked one on top of
the other and make each one visible or invisible as I step through the form.
I would also have a "Cancel" button that always does the same thing, and a
"Done" button for when I have finished the walk through

Is this the best way to do things, or is there an alternative method?

TIA,

Rob
 
A

Allen Browne

Rob, it seems like it would be easier to use one button.

Create a form-level variable to record what step you are up to: at the top
of the form's module (with the Option statements):
Dim intStep As Integer

Then in the Click event of your "Next" button:

intStep = intStep + 1
Select Case intStep
Case 1
'code for step 1
Case 2
'code for step 2
Case ...
Case Else
Msgbox "Forgot to code for step " & intStep
End Select
 

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