Tab to control in subform - how???


G

Guest

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
 
Ad

Advertisements

A

Allen Browne

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
 

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