B
b_lwalker
I've developed a project database that works quite well - but often
times users can be lax in entering all necessary data.
I've got a sub routine that fires for the Form's BeforeUpdate event
that can check the main form's controls - but I run into trouble with
the subforms. In order to stop the user leaving the record before the
information is entered, I Cancel the BeforeUpdate event...but the
record must update in order to set focus to a subform.
At the moment I'm using the following logic:
If ControlName = 0 then
MsgBox "Enter Data message"
ControlName.SetFocus
Cancel = True
Exit Sub
End If
I have the Exit Sub there as I test four different controls (two of
which are subforms) and don't want all the messages jumping up at the
same time. Does anyone have a better way of doing this?
Many thanks,
Bruce Walker
times users can be lax in entering all necessary data.
I've got a sub routine that fires for the Form's BeforeUpdate event
that can check the main form's controls - but I run into trouble with
the subforms. In order to stop the user leaving the record before the
information is entered, I Cancel the BeforeUpdate event...but the
record must update in order to set focus to a subform.
At the moment I'm using the following logic:
If ControlName = 0 then
MsgBox "Enter Data message"
ControlName.SetFocus
Cancel = True
Exit Sub
End If
I have the Exit Sub there as I test four different controls (two of
which are subforms) and don't want all the messages jumping up at the
same time. Does anyone have a better way of doing this?
Many thanks,
Bruce Walker