Setting focus on a control after error in input

E

Eric Blitzer

I have a for with a date field.
in the after update
If the date entered does not meet certain criteria i set it to null.
This works fine
When I add the code
me.mydate.setfocus nothing happens. The cursor goes to the next control

I want the cursor to go back to the errored control
 
R

ruralguy via AccessMonster.com

Your date verification should be in the BeforeUpdate event of the date
control and then just set Cancel = True to cancel the update and hold the
focus in the same control.
 
Top