Provided by Allen Browne, January 2004. Updated February 2007.
If you apply conditional formatting to calculated controls, you may start an endless loop where the form recalculates continually and fails to display the results. This happens in Access 2000, and 2002. It also occurs in Access 2003 if Service Pack 1 has not been applied.
AccessFlaws.zip contains a form named Dates. It demonstrates the problem with just two text boxes: TheDate bound to a date field, and txtDueDate bound to this expression:
=[TheDate] + 30
The idea is to allow 30 days for payment, and show the record in red if that date has already past. The txtDueDate text box has Conditional Formatting (Format menu) for the condition:
[txtDueDate] < Date()
However, when you open the form, you see txtDueDate is displayed for the first row only. The status bar reads "Calculating..." constantly, and the calculation never completes for subsequent rows of the continuous form.
Because of this failure, you will see other weird behaviours as well. For example, a text box may receive focus, even if its Enabled property is set to No. A system with limited resources may even crash.
Avoid using conditional formatting where the endless recalculation loop is triggered.
Update February 2007
This problem still occurs in Access 2003 under certain conditions (the mouse cursor over a combo in a subform when the form is opened, if the combo has conditional formatting and a zero-width bound column.)
|Home||Index of tips||Top|