GoToControl to a subform footer button

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!
 
M

Marshall Barton

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
 

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