GoToControl to a subform footer button

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

Guest

Not sure why I can't get this syntax right, but I'm sure someone in here
knows...

I'm on my main form [audits]. When I set off the LostFocus event, I want to
move to my subform [auditresults subform] and set the focus to a button on
the footer of that subform named 'finalize'.

I've tried first moving to the subform itself, then moving to the button and
going straight to the button, but neither work.

What's my syntax for this in the GoToControl function within the macro I'm
using for my Lost Focus event?

THX!
 
Robert_L_Ross said:
Not sure why I can't get this syntax right, but I'm sure someone in here
knows...

I'm on my main form [audits]. When I set off the LostFocus event, I want to
move to my subform [auditresults subform] and set the focus to a button on
the footer of that subform named 'finalize'.

I've tried first moving to the subform itself, then moving to the button and
going straight to the button, but neither work.

What's my syntax for this in the GoToControl function within the macro I'm
using for my Lost Focus event?


First, you can not change the focus in the LostFocus event
where the focus is already in the process of changing. Use
the Exit event instead.

Second, instead of using DoCmd, it is better to use the
SetFocus method:

Me.subform.SetFocus
Me.subform.Form.control.SetFocus
 
Back
Top