Conditional Formatting

G

Guest

I have a continuous form in which users select machines and it brings over a
current price.
In the price table are a price date and a validity time in months.

I conditionally format the price control using an expression
DateAdd("m",[PriceValidityMonths],[PriceDate])>=Now()
to check the price is still valid; if not the price is coloured red.

In the form footer I sum all these prices and would like to know if there is
a way to have this conditionally formatted such that if any of the prices is
invalid, it's coloured red.

Any help/pointers gratefully received. I'm using Access 2000 and am pretty
much useless with it. Andy
 
D

Doug Munich

I'm not sure I understand your design completely, but here is one way to
create a form with conditional highlighting on a field in the body and have
it applied to a sum in the footer.

Set up a query to feed the form with the fields you want to show and an
expression field like..

Expired: DateAdd("m",[PriceValidityMonths],[PriceDate])>=Now()

This field will have a value -1 if the price is still valid, 0 otherwise.
Then on the form apply the conditional highlighting to the Price field in
the body of the form as before (I used the expression

[Expired]<>0

to make the text bold). Then in the footer create a field to show the sum
of the price field and apply conditional formatting with the expression

Sum([Expired])<>0

to make the field bold. If any body price is bold, then the summary field
will be bold.

Doug
 
G

Guest

Doug

Many thanks for your reply and help - works perfectly.


Andy


Doug Munich said:
I'm not sure I understand your design completely, but here is one way to
create a form with conditional highlighting on a field in the body and have
it applied to a sum in the footer.

Set up a query to feed the form with the fields you want to show and an
expression field like..

Expired: DateAdd("m",[PriceValidityMonths],[PriceDate])>=Now()

This field will have a value -1 if the price is still valid, 0 otherwise.
Then on the form apply the conditional highlighting to the Price field in
the body of the form as before (I used the expression

[Expired]<>0

to make the text bold). Then in the footer create a field to show the sum
of the price field and apply conditional formatting with the expression

Sum([Expired])<>0

to make the field bold. If any body price is bold, then the summary field
will be bold.

Doug


Andy Bailey said:
I have a continuous form in which users select machines and it brings over a
current price.
In the price table are a price date and a validity time in months.

I conditionally format the price control using an expression
DateAdd("m",[PriceValidityMonths],[PriceDate])>=Now()
to check the price is still valid; if not the price is coloured red.

In the form footer I sum all these prices and would like to know if there is
a way to have this conditionally formatted such that if any of the prices is
invalid, it's coloured red.

Any help/pointers gratefully received. I'm using Access 2000 and am pretty
much useless with it. Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top