|
In this lesson, you will see how to display records from two different tables that correspond to each other. This is a particularly useful technique in database programming. In this lesson, we will display personal information about students from the Person table which corresponds to academic information about the same students in the Student table. You will perform the following tasks:
To add another VAccess control:
To join two VAccess controls:

The information displayed in the dialog box shows the table from which you are joining (Person), the selected index of that table (0-1D), the VAccess control to which you are joining (VAccess1), and the fields available in that control.
To join two fields, one from each VAccess control, the data types must be the same (i.e., both strings, both integers, etc.). In this case, the names of the fields you will join are also the same (ID to ID), but this does not have to be the case.
In the list box on the left is the index of Person table (ID). The data in that field is equivalent to the ID field of the VAccess1 VAccess control, which is the third item in the list box on the right.
The ID field then appears under the Equals column, showing that it is joined to the ID field of the VAccess2 control. The dialog box should appear like the one in Figure 6-13-.

VAccess1:IDThis text indicates that the selected VAccess2 control will be joined to the VAccess1 control via the ID fields.
Now you will add another form. This form will display personal data on the students in read-only format.
To create a read-only form with joined fields:


When the user selects a different student ID in the frmStudentBrowser form, that student's information will be displayed in the Personal Data form.

You are now ready to save your work and test the application again. Run the program and test all the features of your application.
|
Chapter contents
Prev topic: Lesson 2: Creating an Update Form
|