Creating Match Fields


As first discussed on page 89, you need to create match fields in your source and destination files before you can define their relationship using a link. As our match field, we'll use an automatically generated serial number in the source file and an identically named field in the destination field. (For more information on using the Auto-Enter option, see page 100.) By the way, once the two files are linked, you can display any field stored in the source file within your destination file (not just the match fields).

To create match fields in a source file/table

1.

Open the source file(customersEG in our example), then choose File > Define > Database ( in Windows, on the Mac).

2.

When the Define Database dialog box appears, click the Fields tab. In the Field Name text window, enter a name that makes it obvious that this will act as a match field. (In our example, we use CustomerID#.) Select Number from the Type drop-down menu and click the Options button (Figure 10.2).

Figure 10.2. In the Field Name text window, enter a name that makes it obvious that this will act as a match field.


3.

When the Options dialog box appears, click the Auto-Enter tab, then select Serial number and On creation (Figure 10.3). To guard against this number being accidentally changed later, select Prohibit modification of value entry during data entry. (It's up to you whether to use the next value or increment by choices. In our example, we've set the next value so our very first record will have a Customer ID# of 01.) Click OK to close the dialog box.

Figure 10.3. Click the Auto-Enter tab, then select Serial number and On creation.


4.

When the Define Database dialog box reappears, the Options column lists your auto-enter choices (Figure 10.4). Click OK to apply the choices and close the dialog box.

Figure 10.4. When the Define Database dialog box reappears, the Options column lists your auto-enter choices.


Tip

  • You don't have to create match fields while defining the relationships between files, as done in this chapter. If you plan ahead, you could create them when first defining fields, as explained in Chapter 9. Any records generated before the field was created, however, will have to be filled manually using the Replace Field Contents command ( in Windows, on the Mac).


To create a match field in a destination file/table

1.

Open the destination file (ordersEG in our example), then choose File > Define > Database ( in Windows, on the Mac).

2.

When the Define Database dialog box appears, click the Fields tab (Figure 10.5). In the Field Name text window, enter the exact same name you used for the match field in the source file. (In our example, that's CustomerID#.) Select Number from the Type drop-down menu but do not click the Options button. Instead, click OK to close the Define Database dialog box. You're now ready to link the match fields by creating a relationship (see the next page).

Figure 10.5. In the Field Name text window, enter the exact same name you used for the match field in the source file.


Tip

  • In step 2, there's no need to open the Options dialog box because the value for the match field will come from the source file/table.




FileMaker Pro 8 for Windows and Macintosh(c) Visual Quickstart Guide
FileMaker Pro 8 for Windows & Macintosh
ISBN: 032139674X
EAN: 2147483647
Year: 2006
Pages: 184
Authors: Nolan Hester

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net