Setting focus to field on subform

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

Guest

I am using me.myfield.setFocus to put the cursor in myfield when my form
opens. myfield is on a subform within my form. No problem with that.
I then have some validation that cuts in when a value is input into myfield.
If the validation fails I blank out what was entered and want the cursor to
be postioned back in myfield (on the subform) ready to type in again. This
time me.myfield.setFocus doesn't work - the cursor just disappears.Can anyone
tell me how to do what I want.
 
kbrad said:
I am using me.myfield.setFocus to put the cursor in myfield when my form
opens. myfield is on a subform within my form. No problem with that.
I then have some validation that cuts in when a value is input into myfield.
If the validation fails I blank out what was entered and want the cursor to
be postioned back in myfield (on the subform) ready to type in again. This
time me.myfield.setFocus doesn't work - the cursor just disappears.Can anyone
tell me how to do what I want.

Hi kbrad,
use the beforeUpdate event for data validation of a control. If the
validation fails, set cancel = true

Luck
Jonathan
 
Back
Top