Setfocus on other forms control (1 Viewer)

Wysy

Registered User.
Local time
Today, 11:35
Joined
Jul 5, 2015
Messages
333
Hi,
I have a question with setting focus on another forms control. The code
Code:
Forms!frmvisitEnt!fsubVisitEntTM.Form!fsubVisitEntTMD.Form.Cost.SetFocus
So this sets the focus on the requested control (subform is embedded in the subform of a form). The textbox Cost has the focus however i need to click on it to be able to enter input. I would like to have it so that upon receiving the focus be able to type input. The subform containing textbox cost has a datasheet view.
Thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:35
Joined
May 7, 2009
Messages
19,169
can you do it 3x, setting focus on the Subform first.
the 3nd time, set focus to Cost textbox:
Code:
Forms!frmvisitEnt!fsubVisitEntTM.SetFocus
Forms!frmvisitEnt!fsubVisitEntTM!fsubVisitEntTMD.SetFocus
Forms!frmvisitEnt!fsubVisitEntTM!fsubVisitEntTMD.Form!Cost.SetFocus
 
Last edited:

Wysy

Registered User.
Local time
Today, 11:35
Joined
Jul 5, 2015
Messages
333
Thanks for the fast reply.
I copied the code but does not work.
 

Wysy

Registered User.
Local time
Today, 11:35
Joined
Jul 5, 2015
Messages
333
Just the main form setfocus missing
Code:
Forms!frmVisitEnt.Setfocus
Thank you for your help. It works now!
 

Users who are viewing this thread

Top Bottom