GoToControl

  • Thread starter Thread starter Ron Carr
  • Start date Start date
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
 
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]
 
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
 
-----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"
 
Back
Top