Cursor

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
 
J

Jeff Boyce

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>
 

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

Top