I have a combo box on the main form. After update of this, I would like the
focus of the cursor to move to a specific field in the subform. I've been
trying various different .setfocus combinations with no success.
e.g. forms!frmMain!frmTimesheetInputSub!ElementCode.SetFocus
Can anyone provide the syntax?
Yours
Paul
Each form (main and sub) has its own active control, so this is a 2 step
process:
1. Set focus to the subform control first.
(This makes the subform the active control of the main form.)
2. Set focus to the desired control in the subform.
Like this:
Me.frmTimesheetInputSub.SetFocus
Me.frmTimesheetInputSub.Form!ElementCode.SetFocus
If the ".Form" bit is new, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I have a combo box on the main form. After update of this, I would like
>the
[quoted text clipped - 8 lines]
>
> Paul