G
Guest
I've set up validation criteria for null values in the After Update event of
a form. The validation scheme works fine for 4 of the controls, but not for 3
of them. They are all combo boxes, so that isn't the problelm. I tried
putting the validation for these 3 in a different form event, then in the On
Enter and On Dirty events of a text box control. The references to the combos
contain the correct names of the controls.
Here's the code: (ProgramArea, Category, and Description are the ones not
working)
If IsNull(Me!cboInitiator) Then
MsgBox "Please select an initiator."
Me![cboImpact].SetFocus
ElseIf IsNull(Me!cboState) Then
MsgBox "Please select a location."
Me![cboState].SetFocus
ElseIf IsNull(Me!cboProgramArea) Then
MsgBox "Please select a program area."
Me![cboProgramArea].SetFocus
ElseIf IsNull(Me!cboCategory) Then
MsgBox "Please select a category."
Me![cboCategory].SetFocus
ElseIf IsNull(Me!cboDescription) Then
MsgBox "Please select a description."
Me![cboDescription].SetFocus
ElseIf IsNull(Me!cboGroup) Then
MsgBox "Please assign a group."
Me![cboGroup].SetFocus
ElseIf IsNull(Me!cboImpact) Then
MsgBox "Please identify the impact."
Me![cboImpact].SetFocus
End If
a form. The validation scheme works fine for 4 of the controls, but not for 3
of them. They are all combo boxes, so that isn't the problelm. I tried
putting the validation for these 3 in a different form event, then in the On
Enter and On Dirty events of a text box control. The references to the combos
contain the correct names of the controls.
Here's the code: (ProgramArea, Category, and Description are the ones not
working)
If IsNull(Me!cboInitiator) Then
MsgBox "Please select an initiator."
Me![cboImpact].SetFocus
ElseIf IsNull(Me!cboState) Then
MsgBox "Please select a location."
Me![cboState].SetFocus
ElseIf IsNull(Me!cboProgramArea) Then
MsgBox "Please select a program area."
Me![cboProgramArea].SetFocus
ElseIf IsNull(Me!cboCategory) Then
MsgBox "Please select a category."
Me![cboCategory].SetFocus
ElseIf IsNull(Me!cboDescription) Then
MsgBox "Please select a description."
Me![cboDescription].SetFocus
ElseIf IsNull(Me!cboGroup) Then
MsgBox "Please assign a group."
Me![cboGroup].SetFocus
ElseIf IsNull(Me!cboImpact) Then
MsgBox "Please identify the impact."
Me![cboImpact].SetFocus
End If