G
Gina
On my form, there are 2 combo boxes and a few other bound text boxes.
All have been tagged as "Required". I want to test that all the form
fields have been entered before the form is closed.
The user selects a value in combo 1. In the afterupdate event of combo
1, combo 2 is requeried to narrow down the selections available. The
user is then required to make a selection from combo 2.
On the close button I have this code to check that all the fields on
the form have been entered.
If Me.Dirty Then
For Each ctl In Me
If ctl.Tag = "Required" And IsNull(ctl) Then
MsgBox ctl.Name & " must be entered."
ctl.SetFocus
Exit Sub
End If
Next ctl
End If
This code works for all the fields except combo 2. The form will
close with no error message if all fields have been populated but
combo 2 is left blank.
I am stumped as to why this should happen. Can anyone help?
All have been tagged as "Required". I want to test that all the form
fields have been entered before the form is closed.
The user selects a value in combo 1. In the afterupdate event of combo
1, combo 2 is requeried to narrow down the selections available. The
user is then required to make a selection from combo 2.
On the close button I have this code to check that all the fields on
the form have been entered.
If Me.Dirty Then
For Each ctl In Me
If ctl.Tag = "Required" And IsNull(ctl) Then
MsgBox ctl.Name & " must be entered."
ctl.SetFocus
Exit Sub
End If
Next ctl
End If
This code works for all the fields except combo 2. The form will
close with no error message if all fields have been populated but
combo 2 is left blank.
I am stumped as to why this should happen. Can anyone help?