BOF, EOF Properties Example
This example uses the BOF and EOF properties to detect the limits of the Publishers table. It moves through the records first from the beginning of the file to the end, and then from the end to the beginning. The MoveLast method is required because there is no current record immediately following the first loop.
Data1.DatabaseName = "BIBLIO.MDB"
Data1.RecordSource = "Publishers" ' Open table.
Do Until Data1.Recordset.EOF ' Until end of file.
Data1.Recordset.MoveNext ' Move to next record.
Data1.Recordset.MoveLast ' Move to last record.
Do Until Data1.Recordset.BOF ' Until beginning of file.
Data1.Recordset.MovePrevious ' Move to previous record.