Where Does a Formula Go?

TLDR – if you need a value, use a formula. If you want to perform actions, use a procedure.

Formulas calculate a value. Unlike mathematical formulas, the calculated value can be a number, text, or a binary value, but there is always a value produced as the result. Formulas are built up from constants, operators and functions.

Procedures perform actions – open a window, sort the data, etc. There is no value calculated. Each action is performed by a statement.

Many procedure actions use formulas to calculate needed value. For example, if you want to open a form, you need to use a formula to calculate the name of the form. (Of course usually this formula is just a simple constant, but it doesn’t have to be.) I think this sometimes causes confusion, because procedures almost always contain formulas mixed in.

There is a method where a formula can have actions mixed in, but that is a rare advanced technique so you shouldn’t worry about it.

1 Like