Recalc Method

Description

The Recalc method immediately updates all calculated controls on a form.

Syntax

form.Recalc

The Recalc method uses the following argument.

Argument

Description

form

A Form object representing the form that contains the controls for which you want to recalculate the values.


Remarks

Using this method is equivalent to pressing the F9 key when a form has the focus. You can use this method to recalculate the values of controls that depend on other fields for which the contents may have changed.

See Also

Form Object, Refresh Method, Repaint Method, Requery Method.

Example

The following example uses the Recalc method to update controls on an Orders form. This form includes the Freight text box, which displays the freight cost, and a calculated control that displays the total cost of an order including freight. If the statement containing the Recalc method is placed in the AfterUpdate event procedure for the Freight text box, the total cost of an order is recalculated every time a new freight amount is entered.


Sub Freight_AfterUpdate()
    Forms!Orders.RecalcSub