Required field

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

Guest

Silly question! I have a required field on a form, and I have it set up so
that on exit, a message box pops up if the field is null. After clicking OK
on the message box, the cursor moves to the next field. I want the cursor to
return to the required field instead of going to the next field. Can this be
done?
 
Yep just set the focus back to that field.

I think you can also insert a "cancel" if you are using an "on exit" event.

Rick B
 
Thanks for the reply! I tried that, but it's not working. Here's what I have:

If IsNull(Me.cmbRequestor) Then
MsgBox "Please enter your name in the Submitted By field"
Me.cmbRequestor.SetFocus

End If

What am I missing?
 
Everything looks as though it should work. Are you getting the Message Box
to pop up. I'm wondering if the value of cmbRequestor, although apparently
empty, is found to be Null. You may have to change your first line to...

If cmb.Requestor = "" Then
 
I believe this code runs BEFORE the EXIT event, so it sets the focus, then
exits the field.

Try CANCEL.

Rick B
 
Back
Top