Userform

mcfly

Board Regular
Joined
May 15, 2002
Messages
162
I have a userform with a multipage which contains 8 pages. How can I code it to where if the person entering in the userform misses a section "somehow" it will go back to the page that is empty? Instead of going back 1 page at a time. If there is a way to even do this.

Here is the code I have now.

Private Sub BACKBUTTON_Click()
MultiPage1.Value = MultiPage1.Value - 1
updatecontrols
End Sub

Sub updatecontrols()
'the name field is required

Select Case MultiPage1.Value
Case 0
BackButton.Enabled = False
NextButton.Enabled = True
Case MultiPage1.Pages.Count - 1
BackButton.Enabled = True
NextButton.Enabled = False
Case Else
BackButton.Enabled = True
NextButton.Enabled = True
End Select


If TextNAME.Text = "" Then
OKBUTTON.Enabled = False
Else
OKBUTTON.Enabled = True
End If

'update the caption
Me.Caption = APPNAME

End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Fryer Tuck

Board Regular
Joined
Mar 20, 2002
Messages
64
You must be doing a check somewhere to see that something is missed. (A good place may be when a you change pages.) during the check, note which page has data missing and send the user to that page by doing a

MultiPage1.Value =

statement.
F.T.
 

Forum statistics

Threads
1,144,354
Messages
5,723,884
Members
422,524
Latest member
wirkkarn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top