Microsoft Access VBA Programming for the Absolute Beginner

Moves the record pointer to a particular record.

Syntax

DoCmd.GoToRecord [ObjectType][, ObjectName][, Record][, Offset]

with the following parameters:

ObjectType

An AcDataObjectType constant indicating the type of data in which the record pointer is to move. Possible values are acActiveDataObject (the currently active data object, which is the default value), acDataForm (a form’s data), acDataFunction, acDataQuery (a query’s data), acDataServerView, acDataStoredProcedure, and acDataTable (a table’s data).

ObjectName

The name of the object of type ObjectType.

Record

An AcRecord constant indicating the record to go to. Possible values are acFirst (the first record), acGoTo (go to the record specified by the Offset argument), acLast (the last record), acNewRec (a new record), acNext (the next record, which is the default value), and acPrevious (the previous record).

Offset

The number of records to move backward (if Record is acPrevious) or forward (if Record is acNext), or the record number to go to (if Record is acGoTo).

Example

See the example for the FindRecord method.

Comments

Категории