Cursor

  • Thread starter Thread starter vina
  • Start date Start date
V

vina

Is it possible to control where the cursor is pointed to
in a form? What I am trying to do is I have a field
checking, required fields, if it's blank it give a
message that this is a required field i want that when
they hit ok it will automatically go to that field in the
form.

Any help and suggestion is appreciated.
Thanks
Vina
 
Vina

If you add validation checking code to the BeforeUpdate event for the form,
you can test (and react) to all those fields you consider "required".

For example, you might include something like (your actual syntax may vary):

If Nz(Me!txtYourRequiredField,"") = "" Then
Msgbox "YourFieldLabel is required.", vbOKOnly
Me!txtYourRequiredField.SetFocus
Cancel = True
ElseIf ... 'another test
...
End If

This would check the field named, converting a Null to a zero-length string,
to see if there's nothing in it. If there's nothing in it, a message
appears and the focus is set to the control.

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top