What are Related Forms?

Related Forms are simply forms that display data from related tables, views and CursorAdapters in a coordinated way. At least one form displays data from a parent table, view or CursorAdapter. Other forms display data from child, grandchild, etc. tables. When a parent record is displayed on a parent form, the child forms must display records related to the parent record. 

VPM Enterprise provides a Related Forms engine that is quite unique. The Related Forms engine coordinates the display of parent, child, grandchild, etc. forms. Letís show you what that means.

Select the Employee Basic Data (Multiple Instances) option on the Employee menu to display that form. Click the Next arrow on the Toolbar so that the form shows Laurie Bensonís record. Select the Benefits option on the Employee menu to display the Benefits form.

Notice that when the Benefits form appears, it automatically displays the benefits records for Laurie Benson. You can tell thatís true by comparing the Employee #ís on the two forms. Click the Next arrow on the Toolbar. Notice that Laurie Bensonís next benefits record appears on the Benefits form.

Click the Parent Mode control on the Toolbar. Itís the first button from the left. The big square on the Parent Mode button should now be yellow. Click the Next arrow on the Toolbar. Notice that even though the Benefits form is active, the Next control moves you through the parent records and refreshes the parent Employee Basic Data form. When Parent Mode is on, you can change the current parent record without leaving a child form.

Your VPM Enterprise applications can enjoy these Related Forms features without the need for you to write one line of Visual FoxPro code.

Tip: The term "Related Forms" as used in this chapter refers to separate forms that maintain data from related tables. Related Forms does not refer to the maintenance of related tables, views and CursorAdapters on the same form. VPM Enterprise provides Form Builders that help you set up related tables, views and CursorAdapters on one form. Those Form Builders are described in the Creating Forms: The Builders chapter. This chapter discusses how to set up your separate forms that want to be related.

Almost every database application could use Related Forms, but surprisingly few have them. If you take a look at many of the most popular commercial database applications, you will see that few of them implement Related Forms. For example, in one of the most popular PC accounting applications, when you have a customer form displayed, you cannot display an invoice form that automatically shows the invoices just for the current customer record. That is a serious deficiency that your VPM Enterprise applications won't have.

Without VPM Enterprise, you would have to develop the FoxPro code yourself to provide the functionality that Related Forms require. VPM Enterprise, however, provides powerful Related Forms functionality for you.

More:

What are Related Tables, Views and CursorAdapters?