Greetings,
I have a form set up with five tabs on a tab control box. The problem I am having is that this is a data entry page and I have the tab control for the text boxes (of which there are several on each page) set up with mandatory input and the focus automatically goes to the next textbox to be filled with data. All works great except that if the user doen't want to complete the entire sequence of data input they can't get out of the form (Can't click the exit button as error messages require the user to enter data in whatever box they are in. Additionally, I would like the user to be able to move to another tab and fill out data in that area without completing all the data entry in other tabs
This project is for employee evaluations and depending on evaluation marks the user is required to enter a comment. The code for text boxes is as follows (note: c11q1 denotes criteria 1.1 quarter 1, etc.)
Private Sub c11q1_Exit(Cancel As Integer)
Dim intVal As Variant
intVal = c11q1
If IsNull(intVal) = True Then
MsgBox "Please enter a value"
c11q1.SetFocus
ElseIf intVal = 1 Or intVal = 2 Then
MsgBox "Enter a reason in the comments section"
mandComment = True
lblc1quickcomment.Caption = "Comment is REQUIRED"
lblc1quickcomment.ForeColor = vbRed
txtc1QuickComment.Visible = True
lblc1quickcomment.Visible = True
txtc1QuickComment.SetFocus
strQtrName = "c11q1"
Else
lblc1quickcomment.Caption = "Comment is NOT required"
lblc1quickcomment.ForeColor = vbBlue
txtc1QuickComment.Visible = True
lblc1quickcomment.Visible = True
txtc1QuickComment.SetFocus
strQtrName = "c11q1"
End If
End Sub
I set strQtrName to the current textbox and after the comment entry the next (based on a select statement) entry textbox is given focus. This is repeated until the process is complete. Like I said, the problem is to break the process to do one of two things (only) 1. to exit 2. to go to another tab
Thank you,
Steve
I set