GoToRecord


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

  • When used with acGoTo, Record represents the position of the record in the current recordset. This is not a permanent value, but rather it changes when records are added and deleted and the recordset is sorted.

  • The GoToRecord method corresponds to selecting the Edit | GoTo menu option.




Access VBA Programming
Microsoft Access VBA Programming for the Absolute Beginner
ISBN: 1598633937
EAN: 2147483647
Year: 2006
Pages: 214
Authors: Michael Vine

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net