Objective:
Developing a record navigation form with unbound controls. The form enables you to navigate through the records one at a time. In this application we have used a combo box, two text boxes and various command buttons.
The following is the run time view of the form shown initially. When the form is loaded the data adapter is filled with data from the database and the combo box is populated with account numbers in ascending order.
Figure 1: Initial view.
The command buttons at the bottom of the form enable you to navigate through all the records one at a time. You can instantly go the first record and the last record by using the first and last button respectively. At the button of the page the current record number with respect to all the records is also displayed.
These buttons are not the only means for navigating trough the records. You can also navigate through the records using the combo box. The combo box enables you to select an account number and one its selected index is changed it will display all the details of that account number, basically the customers name and his balance.
Figure 2: Runtime view showing the last record.
Navigating through the records is not the only thing the system provides. The system also enables you
- Add a new record to the database.
- Edit an existing record in the database.
- Delete an existing record in the database.
When a new record is added or when an existing record is edited, the UPDATE button is used to update the actual database. The CANCEL button can be used in order to discard the changes you were about to make.
When a user clicks the ADD button to add a new record all other buttons but the UPDATE and the CANCEL button are disabled. This is because the other buttons have no significance with the system is in ADD mode. When the customer is done when filling the details of the new record he is supposed to click the UPDATE button to update the actual database or the CANCEL button to discard the current changes.
The following figure shows the runtime view in the form in ADD mode.
Figure 3: ADD mode, only UPDATE and CANCEL buttons are enabled.
Figure 4: ADD mode, done with entering the details of a record.
Figure 5: A new record successfully added.
The following figures show the runtime view of the form in the EDIT mode.
Figure 6: Runtime view of the form in EDIT mode.
Figure 7: An existing record successfully updated.
Figure 8: An existing record successfully deleted.