Goto Control Container and Sub From

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,704
Office Version
  1. 2016
Platform
  1. Windows
I am trying to set a find button to select a field in a subfrom and the subform is within a contain. the detials are:

command button is on the main form: frmSearchEngine

Contain name: child27
Sub Form name is: frmCombinedSearchEngine
Field to be selected before find option is activated is: Policy_Ref

Any help is appreciated
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

strive4peace

Well-known Member
Joined
Jul 6, 2009
Messages
678
Hi Trevor,

Code:
   Me.subform_controlname.SetFocus
   Me.subform_controlname.form.controlname.SetFocus
btw, I usually make the subform control name (ie: child27) the same as the form name it contains -- unless I am using multiple copies of the same subform in which case, of course, they have to be named differently
 

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,704
Office Version
  1. 2016
Platform
  1. Windows
Hi Trevor,

Code:
   Me.subform_controlname.SetFocus
   Me.subform_controlname.form.controlname.SetFocus
btw, I usually make the subform control name (ie: child27) the same as the form name it contains -- unless I am using multiple copies of the same subform in which case, of course, they have to be named differently

Thanks Crystal this will help
 

strive4peace

Well-known Member
Joined
Jul 6, 2009
Messages
678
Re: Goto Control Container and Sub From.

you're welcome, Trevor ;) happy to help
 

Watch MrExcel Video

Forum statistics

Threads
1,129,754
Messages
5,638,170
Members
417,011
Latest member
Amaden95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top