|
In this section you will learn how to add another form to the project. This form will allow users to update information in the Student Browser, view additional information on students, and delete student records. The form will use multiple Pervasive.SQL ActiveX text buttons, option buttons, and command buttons.
After this lesson, you will be able to perform the following tasks:
To add another form to your project:
Visual Basic adds a third form to the project.
The frmStudentUpdate form will open when the user presses the Update Student Data button on the frmStudentBrowser form. When the user selects a specific student ID and then click the Update Student Data button, the form will display various details about the specific student.
frmStudentUpdate.Show frmVAccessForm.VAccess1.RefreshThe first line displays the form, and the second line invokes the Refresh method which updates the data in all controls bound to the VAccess1 VAccess control. If the Refresh method were not used in this case, the controls you are about to place on the frmStudentUpdate form would be blank when the form appeared. The Refresh method updates the data in these controls according to the VAccess control's data buffer, causing the form to show the data as soon as it appears.
To add VATextBoxes:
To add command buttons:

The VAOperation property assigns a Pervasive.SQL operation to the VACommandButton to be performed when the button is clicked. This operation occurs after any code in the Click event.
You now have buttons on the form which will add new student records to the database, modify existing student records, and delete student records.
Note
Most of the fields are the same in both forms, though each form has fields that the other does not. The fields that are the same on both forms are the ones the user can update.
You will probably want to use Visual Basic Label controls to identify each of the VATextBoxes on the form and to arrange the controls neatly on the form. The form should be similar to the following figure:

To test the features you added in this lesson:
The Update Student Information form opens and displays the fields for the specific student selected in the list. Notice as you scroll through the list on the Student Browser window how the data on the two forms remains in sync.
|
Chapter contents
Prev topic: Lesson 1: Creating a Data Browser
|