Navigating Recordsets
See Also
Once you have bound controls on a Visual Basic form to a DataEnvironment object, you can add navigation buttons that allow the user to move through data at run time.
To add navigation buttons to your Visual Basic form
-
Drop two Command buttons on your form. You will use these to navigate through your Data Environment's Recordset object.
-
Right-click your Visual Basic form and select View Code from the shortcut menu.
-
For the Previous button, add the following code to the Click event.
DECustomers.rsCustomers.MovePrevious
-
For the Next button, add the following code to the Click event.
DECustomers.rsCustomers.MoveNext
-
Click Run on the Visual Basic toolbar to run your form, and click the Previous and Next buttons to navigate between records.
Note You can use any ADO method in this procedure, such as MoveFirst or MoveNext. To add update and delete capabilities to your form, use the Update and Delete methods.