Conditional Formatting Question

  • Thread starter Thread starter neitech
  • Start date Start date
N

neitech

I am trying to get conditional formatting to work on a subform withou
any success. The subform has three textboxes which are named a
follows

Expr
CountofUse
CountOfAsse

Below is what I am trying to accomplish:

If [Expr2]+[CountofUser] does not equal [CountOfAsset] I would lik
CountofAsset to be highlighted in Red.

and

If [Expr2]+[CountofUser] = [CountOfAsset] I would like CountOfAsset t
be highlighted in Green.

I have played around with using the Conditional Formatting optio
without any success. If this is possible could someone point me i
the right direction? Thanks in advance for your help
 
Open the form in design mode and right click on the CountOfAsset textbox.
Choose Conditional Formatting. Set the combo boxes to "Field Value Is" and
"Not Equal To". In the next box to the right, type in [Expr2]+[CountOfUser].
Select the Red background color from the Fill button. Now, go up one row and
set the Default fill color to Green.

This will work, depending on how you want to handle Null values in Expr2 and
CountOfUser.
 
Thanks for your help Wayne. I tried this and it still does not see
to work. The default fill color will work but the conditiona
statement does not. Could this be because it is a subform in my mai
form?

All of these fields in the subform are coming from a query. Here i
what the query consists of if that help

[Expr1] is a yes no field- Sum(IIf([Status]=-1,1,0
[Expr2] = [CountOfAsset]-[Expr1]
[CountOfUser] = Count of the user fiel
[CountOfAsset] = Count of the Asset Fiel

Thanks again for your help
 
What doesn't work? Does it never give a red background, does it give a red
background at the wrong times? What are some of the values in the records
returned by the query?
 
It will never give a red background. The values returned by the quer
are just numbers. Conditional Formatting works fine on other parts o
my main form, but it seems like it just doesnt like the subform
Wayne Morganwrote
What doesn't work? Does it never give a red background, does it giv
a red
background at the wrong times? What are some of the values in th records
returned by the query

--
Wayne Morga
MS Access MV


Thanks for your help Wayne. I tried this and it still does no see
to work. The default fill color will work but the conditiona
statement does not. Could this be because it is a subform in m mai
form

All of these fields in the subform are coming from a query. Her i
what the query consists of if that help

[Expr1] is a yes no field- Sum(IIf([Status]=-1,1,0
[Expr2] = [CountOfAsset]-[Expr1
[CountOfUser] = Count of the user fiel
[CountOfAsset] = Count of the Asset Fiel

Thanks again for your help
[/quote:577b7bba91
 
Conditional Formatting works well on subforms. In fact, it lets you do some
things on subforms in continuous or datasheet view that you couldn't do
otherwise. The only thing I can think of is that the name of one of the
control in the statement isn't correct.
 
Thanks again for all of your help. I got this working but it doesn'
make sense to me why it is working. I changed the formula in th
conditional statement to the names of the control source instead o
the names of the combo boxes. All my other conditional formattin
on my forms are based off the combo box names. Very strange bu
since it is working I'll take it.
Wayne Morganwrote
Conditional Formatting works well on subforms. In fact, it lets yo
do some
things on subforms in continuous or datasheet view that you couldn' do
otherwise. The only thing I can think of is that the name of one o the
control in the statement isn't correct

--
Wayne Morga
MS Access MV


It will never give a red background. The values returned by th quer
are just numbers. Conditional Formatting works fine on other part o
my main form, but it seems like it just doesnt like th
subform.[/quote:814cc11add
 

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

Back
Top