Team LiB
Previous Section Next Section

One-to-One Relationships

In most cases, forms that present information from two entities that have a one-to-one relationship can be handled just like forms that represent simple entities. You create a query that combines the appropriate fields from the two tables, and then you treat it as a single simple entity. If you have more attributes than can be comfortably displayed on a single form, the same techniques as for simple entities apply.

If the primary entity participates in multiple one-to-one relationships, the nature of the relationships determines the most natural layout. If the relationships can coexist, you can treat them as one big recordset and show the information on a single form or on multiple forms, as we discussed doing for simple entities.

Many times, however, the relationships are mutually exclusive, as when any given Product can be either a Beverage or a Cheese, but not both. This is a good time to use multiple sub-forms or panels, providing you have enough real estate. You needn't worry about users understanding that more related information is available in a given context; there isn't any more information. In fact, using a tab control in this situation would be misleading.

If you have real estate problems, you'll need to use one of the techniques for grouping and displaying attributes that we talked about for simple entities. If the controls representing the attributes of the subclass are placed on a tab, it's best to try to find some generic term for the tab label. It can be confusing for users if a tab label (or command button label) changes as they move through the table.

For the same reason, if users are able to move through the primary recordset, I try to avoid having the controls displaying the attributes of the sub-classed entity on the first tab of the tab control. Since the controls for each subclass are different, the form display will jump as users step through the records. By keeping the sub-classed attributes off the first tab, you can keep the display stable and can incidentally provide some performance benefits by not recalculating the display unnecessarily.

    Team LiB
    Previous Section Next Section