clicking on button in form from subform

Wysy

Registered User.
Local time
Yesterday, 22:36
Joined
Jul 5, 2015
Messages
333
Hi,
I am trying to solve the following problem:
Object is a form/subform one. The header of the form has command button. If the focus is on the subform for entering data and i want to click the command button in the parent form, i need to click twice. I suppose once to move the focus from subform to form's header, then again to run the code behind the button. Is there a way to achive this by clicking only once?
thanks
 
clicking once should run btn_click event,
but what events are running behind the click ?
 
it does not, two click is necessary to run btn_click event. It should open a form.
 
Try the following in the AfterUpdate Event of a Control on your Subform:-

Me.[MainFormName].SetFocus ‘Sets focus to the Form
Me.[MainForm].Form!NameOfButton.SetFocus

Then click the Button
 

Users who are viewing this thread

Back
Top Bottom