Navigate between controls, records, and form pages by using Visual Basic

Navigate between controls, records, and form pages by using Visual Basic

  1. Open the event procedure for the appropriate event in the Code window.

    How?

    For example, to respond to a mouse click on a command button, open the button's Click event procedure.

  2. Do one of the following:

    To move the focus to a specific control or field in the current record, carry out the GoToControl method in the procedure, setting the Control Name argument to the name of the control to which you want to move.

    How?

    To make a specific record the current record or to create a new record, use the GoToRecord method to carry out the GoToRecord action in the procedure.

    To move the focus in the active form to the first control on a specific form page, use the GoToPage method to carry out the GoToPage action in the procedure.

  3. Run the procedure.

    How?

Tip   You can also use Visual Basic for Applications to locate or move between records by using a Recordset object and the Seek method or any of the Move or Find methods.

For more information about the GoToControl action, click .

For more information about the GoToRecord action, click .

For more information about the GoToPage action, click .

For more information about the Recordset object and its methods, click .