Library tutorials & articles
Data Control
The BOF / EOF Action
The BOFAction and EOFAction properties allow you to control what happens when the control reaches the BOF (beginning of file) or the EOF (end of file).
Data1.BOFAction = integer
For the BOFAction property, the settings for integer are:
| Setting | Value | Description |
| vbBOFActionMoveFirst | 0 | MoveFirst (Default): Keeps the first record as the current record. |
| vbBOFActionBOF | 1 | BOF: Moving past the beginning of a Recordset triggers the Data control Validate event on the first record, followed by a Reposition event on the invalid (BOF) record. At this point, the Move Previous button on the Data control is disabled. |
Data1.EOFAction = integer
For the EOFAction property, the settings for integer are:
| Setting | Value | Description |
| vbEOFActionMoveLast | 0 | MoveLast (Default): Keeps the last record as the current record. |
| vbEOFActionEOF | 1 | EOF: Moving past the end of a Recordset triggers the Data control's Validation event on the last record, followed by a Reposition event on the invalid (EOF) record. At this point, the MoveNext button on the Data control is disabled. |
| vbEOFActionAddNew | 2 | AddNew: Moving past the last record triggers the Data control's Validation event to occur on the current record, followed by an automatic AddNew, followed by a Reposition event on the new record. |
If you set the EOFAction property to vbEOFActionAddNew, once the
user reaches the end of the database (ie the last record), and attempts to view
the non-existant next record, a new record is added. If you make changes to
the new record and the user then moves to another record, the record is automatically
appended to the Recordset. If you don't make changes to this new record,
and the user moves to another record, the new record is discarded.
When you use code to move between records the EOFAction property has no effect — it only takes effect when manipulating the Data control with the mouse.
In situations where there are no records in the database or after the last record has been deleted, using the vbEOFActionAddNew option for the EOFAction property greatly simplifies your code because a new record is always editable as the current record. If this option is not enabled, you are likely to trigger a "No current record" error.
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Hi ! All,
I'm new in VB Programming and trying with all your given examples. I'm trying to create a database project. I've created a table in Access 2000 and wants to attatch it with my VB Project. But whenever I run the Project it displays the following error message:
Runtime Error # 3343
Unrecognized Database Format
Please tell me what to do now.
Thanks & Best Regards
From
Bhasker Kumar
Email :- bhaskerno123@yahoo.co.in
im a newbie in vb, im working now with the examples above, my objective is to save,add, delete files to the database i can't do it. there is a propmted error invalid or unqualified references.
i am a newbie in vb,and now im currently working with the tutorials that are post above, my objective is that i want to save, add or delete a file to my stand-alone database. thanks for fast replies.
At least give some explanation about the environment or
what is you objective.
hi there, why is that i can't add or save new file? the error propmt is
"invalid or unqualified reference." plz send me an answer or email it to me plz..hoping to hear from you. ASAP..thanks
The download link doesn't work...
I am currently having problems searching a dbase3 file using the data control. Can anyone offer any suggestions as to searching? I am using bound controls (testboxes) to display the data. I can use the directional buttons to move forward and back but I cannot search for a specific value.
Thanx in Advance
is it the recordsource or what?
it's good control
This thread is for discussions of Data Control.