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
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