ADO Data Control

Running the Project

At this point, you’re ready to run the project so click F5. The form (in Figure A) displays the first record in the bound table (from Nwind.mdb). Click the navigational controls to move from one record to another. Remember, if you change the data in a record and then move to another record, VB will save the change.

Try to add a new record by first clicking the Last button and then clicking the Next button. The first click will display the last record in the bound table. The second click will display a blank record--if you’ve set the data control’s properties accordingly--as shown in Figure B. If your form doesn’t display a blank record, return to Design View, select the ADO data control and change it’s EOFAction property to 2 - adDoAddNew.

Figure B

Once you view a blank (new) record, you may encounter a problem if you try to return to a previous record. If your form includes any required fields, VB won’t let you leave the new record until you enter something in the required fields. This behavior includes primary key fields and any required fields you may not have displayed on your form. You can however, exit your form by clicking the Exit command button.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth