Open Manage | Database | Fields. Define or select a field of type number.
Double click it to open field options
Click the Auto-enter tab
Select the calculation option
enter this calculation expression: self - 2
Clear the "Do not replace existing value" check box.
Note: in some situations, you simply can't do this and get everything that you need. Sometimes there's no alternative to using two fields, one for entering a value and one for performing the calculation. In such cases, you can often set up your layout such that your two fields look and function as though they are one field.
You can use an Auto-Enter Calculation. Check "calculated value", enter self-2 as the calculation, and then uncheck "Do not replace existing value of field"