how to tab to a buttom on the main form a afterupdate event from a subform combo box

Jaymin

Registered User.
Local time
Today, 17:41
Joined
Oct 24, 2011
Messages
70
I have a form with a subform, when i finish entering the data of the last combo box of the subform i would like to have it tab to the exit button on the main form, it sounds easy but i am having alot of trouble doing it, can anyone suggest something for me please.
I have looked at the syntax for main/subform but it not working.
Peter
confused.png
 
This article gives you the correct syntax for referring to forms and subforms and their control and properties from various relative locations. It should help you get the correct syntax for setting the focus you require.
 
sorry i did not know about cross posting will not do it again,
John big booty i have read that post but i cannot get it to work.
I would assume that i should use "me.parent!controlname" to get a afterupdate to point from a combo box on the subform to a button that is located on the main form..

Thanks guys for your help, found what i was doing wrong, had to change the vba control sub from private to public
Peter
 
Last edited:
Correct. Given that you are on the sub form and want to set focus to a control on your main form you would need to use;
Code:
me.parent!controlname.SetFocus
Where controlname is the name of your button.
 

Users who are viewing this thread

Back
Top Bottom