VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] - نسخه متنی

Cynthia L. Baron, Daniel Peck

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











About Self-Relationships


Not only can you relate one table to another, you can also relate records within a table to each other. This is called a self-relationship. There are lots of situations where self- relationships are useful. If you have a table of names containing many contacts that work for the same company, you can create a self-relationship in a portal to list everyone working for the same company on each individual employee's record. Portal entries can be defined as buttons to switch between records. You can also use a self-relationship to do simple finds, create summary fields, and even create lookups to speed up data entry.

To create a self-relationship



1 .Choose File > Define > Database (Control+Shift+D/Command+Shift+D). When the Define Database dialog box appears, click the Relationships tab.

2 .Click the Edit Relationships button. When the Edit Relationships dialog box appears, choose the name of the current table in both drop-down lists (Figure 6.44). In this case, the table is called Customer.

Figure 6.44. To create a self-relationship, choose the current table name in both table lists.


[View full size image]

3 .

Select the field you want to use for the self-relationship from both scrolling lists, then click Add. In our example, we use the Company field (Figure 6.45).

Figure 6.45. Choose the same field name in both field lists.


4 .Click the "Sort records" check box on the right. The Sort Records dialog box will appear.

5 .In this example, we'll set the Sort criteria to LastName by double-clicking to choose it (Figure 6.46). Click OK twice.

Figure 6.46. Choose the Sort Order for a relationship by double-clicking the field name on the left.


6 .

The Add Relationship dialog box will appear. Since this is a self-relationship, you need to add another occurrence of the table to the relationships graph. In the Name of Occurrence input box, type Contacts by Company, then click OK (Figure 6.47). Click OK again to finish.

Figure 6.47. Always give relationships a descriptive title.



To display and access self-relationship data



1 .Switch to the layout that will display the related data and choose View > Layout Mode (Control+L/Command+L).

2 .Make sure the layout has enough room for the portal. If it doesn't, drag the Body tab down to resize the part.

3 .

Click the Portal tool. Click on the layout and drag the pointer out and down to size.

4 .

In the Portal Setup dialog box that appears, click the "Show related records from" drop-down menu and choose the Contacts by Company table occurrence for this portal (Figure 6.48). Click OK.

Figure 6.48. Choose the table occurrence that the portal will use to relate records.


5 .When the Add Fields to Portal dialog box appears, select the fields you want to display.

In this case, we'll add Full Name and Title (Figure 6.49).

Figure 6.49. When you create a portal on a layout, the Add Fields to Portal dialog box automatically appears.


6 .

Click OK to finish. Switch to Browse mode to view the portal with the related data (Figure 6.50).

Figure 6.50. In Browse mode, the portal will display the records from the related tables.


[View full size image]

The names listed in the portal are from the records where the company name is the same as the current record.



/ 227