Database Reference
In-Depth Information
The new criterion appears in the list. Your window should look like Figure 14-3 .
6. Click OK .
Notice that the box on the line between Invoices and Invoices_currentJob has a new
symbol, and both ends of the line are forked to indicate that it's a multiple criteria re-
lationship ( Figure 14-4 ).
7. Click OK .
You're back on the Invoice layout. The current invoice no longer appears in the In-
voices_currentJob portal.
After you perform these steps, the portal shows invoices only where there's more than one
invoice related to the same job. And the current invoice (the one you're viewing on the lay-
out) never shows up in the portal.
If you created a Sum() function after the steps on Advanced Relationships , you may notice
that you solved one problem but have created a new one. That is, the current invoice no
longer shows up in the list, and the calculation field shows the wrong total amount for the
job. Because it's excluded from the relationship used by the portal, the current invoice isn't
included in the sum calculation based on that relationship.
You can fix the problem by adding a new self-join relationship for the Invoice table (follow
the tutorial on Advanced Relationships or copy the existing self-join TO and then edit as ap-
propriate). This one should be set to your original criteria of matching Invoice::Job ID to In-
voice::Job ID (without the multiple criteria). Then create a new Sum() calculation that uses
the relationship you just created. That way, the calculation takes the current invoice into ac-
count, and you get an accurate Job cost total, but since it uses a different relationship to show
an invoice list, the portal doesn't include the current invoice. See the results in Figure 14-4 .
Search WWH ::




Custom Search