Which event would be best

D

Dylan Moran

I have submitted fields and assessed fields on a form.
I want to code such that if an assessed field is not equal to the submitted
field, I would like the assessed field to be bolded and red.

Q1: Which event would be best to put this code in?

Request 2: Some assistance with the formatting code would also be great if
you have the time.

My Form is like below

Submitted Assessed

150.00 150.00
100.00 90.00 (I want the 90.00 to be bolded and red).

---------- ---------
250.00 240.00 (I want the 240.00 to be bolded and red).

Many thanks for any assistance.
Dylan Moran - Melbourne Australia
 
W

Wayne Morgan

If you have Access 2002 (XP) or 2003, the best option isn't an event. In
form design view, right click the control, choose Conditional Formatting, in
the drop down choose Expression, fill in the expression, and set the desired
items.

If you have an older version of Access, you will need to put code in the
form's Current event to check the values each time you go to a different
record and in the AfterUpdate event of each of the controls to check the
values when one of the controls changes.

The syntax for the formatting:
Me.txtAssessed.ForeColor = vbRed
Me.txtAssessed.FontBold = True
 
D

Dylan Moran

Superb. Thanks very much.
Dylan

Wayne Morgan said:
If you have Access 2002 (XP) or 2003, the best option isn't an event. In
form design view, right click the control, choose Conditional Formatting, in
the drop down choose Expression, fill in the expression, and set the desired
items.

If you have an older version of Access, you will need to put code in the
form's Current event to check the values each time you go to a different
record and in the AfterUpdate event of each of the controls to check the
values when one of the controls changes.

The syntax for the formatting:
Me.txtAssessed.ForeColor = vbRed
Me.txtAssessed.FontBold = True
 
K

Klatuu

Conditional Formatting is also available in 2K

Wayne Morgan said:
If you have Access 2002 (XP) or 2003, the best option isn't an event. In
form design view, right click the control, choose Conditional Formatting, in
the drop down choose Expression, fill in the expression, and set the desired
items.

If you have an older version of Access, you will need to put code in the
form's Current event to check the values each time you go to a different
record and in the AfterUpdate event of each of the controls to check the
values when one of the controls changes.

The syntax for the formatting:
Me.txtAssessed.ForeColor = vbRed
Me.txtAssessed.FontBold = True
 
Top