User fails to click option boxes on Tab control

B

Barth Wilsey

I have discovered code on this site that allows the user to use two buttoms
(cmdBack and cmdNext) to navigate among pages in a tab control

Private Sub cmdBack_Click()
Me.Tab = Me.Tab - 1
Call Tab_Change
End Sub

Private Sub cmdNext_Click()
' Add logic to determine whether to allow the wizard to advance
Me.Tab = Me.Tab + 1
Call Tab_Change
End Sub

Private Sub Tab_Change()
Select Case Me.Tab
Case 0
Me.lblWizardCaption.Caption = "This is Page 1"
Me.cmdNext.Enabled = True
Me.cmdNext.SetFocus
Me.Tab.Pages("Page1").SetFocus
Me.cmdBack.Enabled = False
Case 1
Me.lblWizardCaption.Caption = "This is Page2"
Me.cmdBack.Enabled = True
Me.cmdNext.Enabled = True
Me.Tab.Pages("Page2").SetFocus
Case 2
Me.lblWizardCaption.Caption = "This is the last page"
Me.cmdBack.Enabled = True
Me.cmdBack.SetFocus
Me.cmdNext.Enabled = False
Me.Tab.Pages("Page3").SetFocus
End Select
End Sub

My question is how can I stop the user from going to the next page if the
controls (option boxes) are still null? In other words, I am trying to have
the user complete required fields using code behind the form
thanks in advance, Barth
 

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