This property indicates whether the current record position is before the first record in a recordset.
Syntax
recordset.BOF
Return Values
The return value for BOF is Boolean.
The BOF property returns True if the current record position is before the first record, and False if the current record position is on or after the first record.
If the BOF property is True, there is no current record.
Remarks
Use the BOF property to determine whether a Recordset object contains records or whether you have gone beyond the limits of a Recordset object when you move from record to record.
If you open a Recordset object containing no records, the BOF property is set to True, and the RecordCount property setting is 0. When you open a Recordset object that contains at least one record, the first record is the current record and the BOF property is False.
Calling the Delete method, even if it removes the only remaining record from a Recordset, does not change the setting of the BOF property.
The following table shows what happens to the BOF property setting when you call various Move methods but are unable to successfully relocate a record.
Method | BOF |
MoveFirst, MoveLast | True |
Move=0 | No change |
MovePrevious, Move<0 | True |
MoveNext, Move>0 | No change |