G
Guest
I am trying to validate some fields in a subform within a form from code
called from the parent form by referring to the subform fields using the
subform.Controls(n) syntax - fine - the validation works OK.
If I do find a subform field which does not meet validation criteria, I want
to highlight the subform field by setting focus (so the User knows which one
to fix). This is the problem - if I do this in the code, when the code
returns to the parent form, the focus is not apparent. OK here is a sample of
code :-
If IsNull(Me.subfrmTraining1.Controls(7)) Then
MsgBox "Please supply Grade"
Me.subfrmTraining1.Controls(7).SetFocus
........
Hope I expained this OK - It's the Me.subfrmTraining1.Controls(7).SetFocus
that doesn't seem to be working.
Any ideas?
Thanks.
called from the parent form by referring to the subform fields using the
subform.Controls(n) syntax - fine - the validation works OK.
If I do find a subform field which does not meet validation criteria, I want
to highlight the subform field by setting focus (so the User knows which one
to fix). This is the problem - if I do this in the code, when the code
returns to the parent form, the focus is not apparent. OK here is a sample of
code :-
If IsNull(Me.subfrmTraining1.Controls(7)) Then
MsgBox "Please supply Grade"
Me.subfrmTraining1.Controls(7).SetFocus
........
Hope I expained this OK - It's the Me.subfrmTraining1.Controls(7).SetFocus
that doesn't seem to be working.
Any ideas?
Thanks.