04 Formula - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki
Formula method
Sets a formula for a calculation. Returns True if successful, otherwise False.
Applies to
| TableData | ArrData | RsetData | Xdata | XShared |
|---|---|---|---|---|
| ✓ |
Parameters
| Name | Type | Description |
|---|---|---|
| Field | Variant | Name or number of the field to be calculated. |
| CalcProc | Variant | Calculation procedure. |
| Params | Variant (optional) | Parameters where calculation is a user-defined function. |
Sometimes there is a requirement to create cumulative calculations across fields as well as records. For this, there is a Formula method where it is possible to supply the formula for subsequent calculation. Then the CalcAll method carries out the calculations and clears the formulae set by the Formula method. The calculation is carried out across fields in the order in which they were defined and then down records.
Please see the Calc method for full information about the parameters and their use. Formula is identical, except that there is no Scratch parameter (this is a parameter to CalcAll).