D
daren white
I have a userform with comboboxes set as dropdown list. I want to check when
the command button is pushed that the boxes are not blank.
my code is
Dim boolExit As Boolean
Do
If ComboBox1.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf TextBox3.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox2.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox4.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox5.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox6.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox3.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
End If
Loop Until boolExit
which comes up with the error when the box is blank and then hangs, I cannot
access the userform to change the field
the command button is pushed that the boxes are not blank.
my code is
Dim boolExit As Boolean
Do
If ComboBox1.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf TextBox3.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox2.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox4.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox5.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox6.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
ElseIf ComboBox3.Value = "" Then
MsgBox "field is blank", vbCritical
boolExit = True
End If
Loop Until boolExit
which comes up with the error when the box is blank and then hangs, I cannot
access the userform to change the field