Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: Conditional Formatting


Author: Luiz Claudio Rocha MVP

View products that this article applies to.

Summary

Conditional Formatting causes continuous form to enter an unending loop.

↑ Back to the top


Symptoms

When you open a form containing a control with conditional formatting in continuous or datasheet view, the form goes into an unending redraw/repainting loop.

↑ Back to the top


Resolution

1. Open the form in design view and ensure that the control with conditional formatting is not touching or overlapping another control.

2. If Step 1 does not fix the bug, check the Control Source for the control. If it is an expression, move this expression to the query used as the form�s Record Source, creating a new field in the query. Use this new field as the Control Source for the conditionally formatted control.
Example: if the Control Source is �=Date()�, open the query used as the form�s Record Source and create a new field: �MyDate: Date()� in the query. In the conditionally formatted control, choose �MyDate� as Control Source (instead of �=Date()�).
Note: if the Record Source for your form is a table, create a query based on the table, and add the new field to the query.

3. If it�s not possible to move the expression to the source query, you can force an immediate recalculation by using the following code on the OnActivate event of the affected form:

Private Sub Form_Activate()
Me.Recalc
End Sub

↑ Back to the top


More information

Steps to reproduce the behavior

1) Start Access 2003.
2) Create a new (blank) MDB file.
3) Import the "Products" table from Northwind.mdb.
4) Create a new form (Auto form: Tabular) based on the "Products" table.
5) Open this new form in design view.
6) In the Detail section, insert a new textbox. Name it "txtBug" and set its Control Source property to
= [UnitPrice] / 2
7) Open the conditional formatting window for the txtBug control. Set Condition 1 to:
Field value Is Less Than 20
Select red color as background when the condition is true.
8) Click OK and open the form as a continuous form.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB555033, kbhowto, kbpubtypecca, kbpubmvp

↑ Back to the top

Article Info
Article ID : 555033
Revision : 1
Created on : 12/17/2003
Published on : 12/17/2003
Exists online : False
Views : 237