How to error check fields arent null when switching to subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a form with a few subforms on it, where I need the user to fill
out the field txtFristName on the main form before switching to a subfrom
(either by tabbing or clicking). Is it possible to display a message to the
user that they must fill out this field before continuing to the subform?
Access isnt reporting an error so i can't trap it with the onError command.

thanks for any and all help!
ben
 
On the OnGotFocus event of the subform control in the main form you can write
the code

If isnull(Me.FieldName) then
msgbox "Must enter value in field name"
Me.FieldName.SetFocus
End If
 
Thanks for that responce. It was exactly what i was looking for and you did
it very quickly. (i know it was a simple problem, but im still very
greatfull)
 
Glad I could help
Good luck


Ben said:
Thanks for that responce. It was exactly what i was looking for and you did
it very quickly. (i know it was a simple problem, but im still very
greatfull)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top