04 GetOffset - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki

GetOffset method

Transfers data between fields. Returns True if successful, otherwise False.

Applies to

TableData ArrData RsetData Xdata XShared

Parameters

Name Type Description
Field1 Variant Name or number of field to be changed.
Field2 Variant Name or number of field from which the data will come.
Offset Long The offset record position to be used as source of data.
Default Variant (optional) The default value to be used where no data is available.

GetOffset takes data from the field defined by Field2 and transfers it to Field1. If an offset is defined, data is taken from the record before or after the current record by Offset records (positive for a later record, negative for an earlier record). If no offset is required, set Offset to 0.

If there is no record to supply the data (for example on the first record of Offset is -1) then if Default is supplied, this value is used.

GetOffset will generally be faster than Calc to transfer data between fields.