Calculation fields are fantasticthey save time and ensure error-free results. But they have one serious limitation: You can't change their values. Of course you can adjust the calculation itself, but sometimes a field needs the capacity to override its calculated value on a record-by-record basis.
For example, it would be nice if your invoice's Date Due field automatically showed a date 30 days after the date of the invoice itself. But sometimes you might want to make an invoice due earlier or later, based on special circumstances (like a holiday). If you make the Date Due field a calculation field, you don't have this flexibility. The solution is to use a normal Date field with an Auto-Enter calculation (see box on Section 9.5).
Like all the Auto-Enter options (Section 3.3), an Auto-Enter calculation automatically fills in a field's value, but leaves it changeable. You can get all the accuracy and time savings of a calculation field, plus the power to change your mind. Here's how to put it to use:
The fields from the Invoices table appear.
The Field Options dialog box makes an appearance.
The Specify Calculation window appears. It looks just like it did before, but this time you're not creating a calculation field. Instead, you're specifying the calculation used to determine the auto-enter value.
You can use any method you want to build this calculation: Click the field and operators, or type them. Notice that the calculation result is set to Date, and there's no pop-up menu to allow you to change that. Your calculation must resolve to a valid date, or FileMaker will squawk at you.
You return to the database itself.
Now you can create a new invoice and test out your field. When you enter a Date for the invoice, the Date Due field updates instantly with the date 30 days from now. Notice that you can still change the Date Due field if you want.
Part I: Introduction to FileMaker Pro
Your First Database
Organizing and Editing Records
Building a New Database
Part II: Layout Basics
Layout Basics
Creating Layouts
Advanced Layouts and Reports
Part III: Multiple Tables and Relationships
Multiple Tables and Relationships
Advanced Relationship Techniques
Part IV: Calculations
Introduction to Calculations
Calculations and Data Types
Advanced Calculations
Extending Calculations
Part V: Scripting
Scripting Basics
Script Steps
Advanced Scripting
Part VI: Security and Integration
Security
Exporting and Importing
Sharing Your Database
Developer Utilities
Part VII: Appendixes
Appendix A. Getting Help