Fetch

ACCPAC Common Controls

AccpacView.Fetch

Retrieves the next logical record according to the direction and filter set in the last Browse call.

Function Fetch() As Boolean

Return Value

Returns whether a subsequent record exists in the view and is retrieved. If the end of the table is reached, FALSE is returned.

Remarks

To lock the record after retrieval, use FetchLock instead of Fetch.

Example

The following example starts scanning at the record whose bank code is equal to or greater than "SEATAC"; then fetches all subsequent records until the end of the table is reached, or an error occurs. By specifying TRUE as the Ascending parameter in the Browse method, records will be fetched in ascending order.
 

Dim BKACCT1header As AccpacCOMAPI.AccpacView

mDBLinkCmpRW.OpenView "BK0001", BKACCT1header

Dim Status as Boolean

BKACCT1header.Browse "BANK>=""SEATAC""", True

Status = BKACCT1header.Fetch

Do While Status = True

    Status = BKACCT1header.Fetch

Loop