Conditional formatting

R

ReneeD

I have a main form called WorkorderT with a subform called Order Details F.
I would like to have my field called subrate on the subform highlight if it
is greater than my field called truck rate on the same subform, but I do not
want it to highlight if my field called Company Name on my main form has a
certain name in it. Is this at all possible?

Renee
 
A

Allen Browne

1. In form design view, select the text box you want to highlight (subrate.)

2. Right-click and choose Conditional Formatting.

3. Set up Condition 1 to Expression, and enter an expression like this (as
one line):
([subrate] > [truck rate]) AND (([Form].[Parent]![CompanyName] Is Null) OR
([Form].[Parent]![CompanyName] <> "xxx"))

4. Substitute the actual company name for xxx.
 
R

ReneeD

Thank you very much, most of it is working except when I have that specific
company name it still highlights yellow and I don't want it to. Does it
matter that the Company Name field has a row source type of table/query?

Allen Browne said:
1. In form design view, select the text box you want to highlight (subrate.)

2. Right-click and choose Conditional Formatting.

3. Set up Condition 1 to Expression, and enter an expression like this (as
one line):
([subrate] > [truck rate]) AND (([Form].[Parent]![CompanyName] Is Null) OR
([Form].[Parent]![CompanyName] <> "xxx"))

4. Substitute the actual company name for xxx.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ReneeD said:
I have a main form called WorkorderT with a subform called Order Details F.
I would like to have my field called subrate on the subform highlight if
it
is greater than my field called truck rate on the same subform, but I do
not
want it to highlight if my field called Company Name on my main form has a
certain name in it. Is this at all possible?

Renee
 
A

Allen Browne

So CompanyName is a combo? It may be bound to a Number field, but have the
Column Widths and Bound Column set so that it displays the name.

If the name is in the 2nd column, you might try:
([subrate] > [truck rate]) AND ([Form].[Parent]![CompanyName].Column(1)
<> "xxx")

These can be a pain to debug, as they give no error message. If there's a
mistake, they just don't work until you get it right.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ReneeD said:
Thank you very much, most of it is working except when I have that
specific
company name it still highlights yellow and I don't want it to. Does it
matter that the Company Name field has a row source type of table/query?

Allen Browne said:
1. In form design view, select the text box you want to highlight
(subrate.)

2. Right-click and choose Conditional Formatting.

3. Set up Condition 1 to Expression, and enter an expression like this
(as
one line):
([subrate] > [truck rate]) AND (([Form].[Parent]![CompanyName] Is Null)
OR
([Form].[Parent]![CompanyName] <> "xxx"))

4. Substitute the actual company name for xxx.

ReneeD said:
I have a main form called WorkorderT with a subform called Order Details
F.
I would like to have my field called subrate on the subform highlight
if
it
is greater than my field called truck rate on the same subform, but I
do
not
want it to highlight if my field called Company Name on my main form
has a
certain name in it. Is this at all possible?
 

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