Move the Cursor to a Control

To move the cursor to a specific control on an open form (from within a standard module), use the syntax

Forms![formName]![controlName].SetFocus

For example, the following VBA statements open a form named NewCust and move the cursor to a control named TaxExempt on that form:

'Open my NewCust form in Form view. DoCmd.OpenForm "NewCust", acNormal

'Move the cursor to the Tax Exempt control. Forms![NewCust]![Tax Exempt].SetFocus

0 0

Post a comment