Sub Sub Form control set focus

S

Silvio

Hello is there a way to simplify the 3 lines of codes below to set focus from
the main form to a control in subform2?

Me.frmCalibration2.SetFocus 'Subform 1
Me.[frmCalibration2].Form![frmOxygen1].SetFocus 'Subform 2
Me.[frmCalibration2].Form![frmOxygen1].Form![cmbTemp].SetFocus 'Set focus on
cmbTemp

Thank you,
Silvio
 
A

Allen Browne

No, that's right.

Each form has an active control. For the user to experience the sub-subform
control as the one that has the focus, you need to do all these:
- make cmbTemp the active control in the sub-subform,
- make the frmOxygen1 subform control the active control in the middle form,
- make frmCalibration2 subform control the active control in the main form.
 
S

Silvio

Once again thank you Allen for you response.

Allen Browne said:
No, that's right.

Each form has an active control. For the user to experience the sub-subform
control as the one that has the focus, you need to do all these:
- make cmbTemp the active control in the sub-subform,
- make the frmOxygen1 subform control the active control in the middle form,
- make frmCalibration2 subform control the active control in the main form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Silvio said:
Hello is there a way to simplify the 3 lines of codes below to set focus
from
the main form to a control in subform2?

Me.frmCalibration2.SetFocus 'Subform 1
Me.[frmCalibration2].Form![frmOxygen1].SetFocus 'Subform 2
Me.[frmCalibration2].Form![frmOxygen1].Form![cmbTemp].SetFocus 'Set focus
on
cmbTemp

Thank you,
Silvio
 

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