GoToControl

R

Ron Carr

I have a number of subforms, each of which is activated (subForm
SourceObject set to a form name) upon clicking a button.

How do I set the focus on a given control?
I have put a GoToControl on all sorts of events and nothing works!
Access 2000
 
K

Ken Snell

You need two GoToControl actions to set focus on a control in a subform. The
first one sets focus on the subform control; the second on the control in
the subform:

Action: GoToControl
Control Name: [subform]

Action: GoToControl
Control Name: [subform]![controlname]
 
J

Jason

To reference a control on a subform use the following
format:

[Forms]![MainFormName]![SubFormName].[Form]!
[SubFormControlName]

Or for short on the current form:

Me.[Form]![SubFormControlName]

HTH,

Jason
 
G

Guest

-----Original Message-----
I have a number of subforms, each of which is activated (subForm
SourceObject set to a form name) upon clicking a button.

How do I set the focus on a given control?
I have put a GoToControl on all sorts of events and nothing works!
Access 2000


.

In the "On Current" property of the sub-form:
DoCmd.GoToControl "key in your control name here"
 

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