Validate and setfocus

  • Thread starter Thread starter E Schiele
  • Start date Start date
E

E Schiele

I am trying to validate a field on a form and simply
setfocus back to the field if the user clicks "No" in
a 'keep value?' message box. I validating
using 'AfterUpdate' event. I can see it go back to the
correct field for a split second, then it jumps to the
next field. I can't figure out why. If I
try 'BeforeUpdate', I get an error that I must save the
record before Setfocus. I would like to cancel the
update, but I don't see how to do that.

Any help is greatly appreciated!

Ed
 
Use the BeforeUpdate Event and instead of SetFocus, just set the argument
Cancel to True.
 
Did the trick! Thanks very much!
-----Original Message-----
Use the BeforeUpdate Event and instead of SetFocus, just set the argument
Cancel to True.

--
HTH
Van T. Dinh
MVP (Access)






.
 

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