Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Conditional Format works - One don't

Status
Not open for further replies.

EllieFant

MIS
May 15, 2001
513
US
I have put the following code in the on format event procedure of my reports details.

If Me.HiredA < Me.ReqA Then
Me.HiredA.ForeColor = vbRed
Else
Me.HiredA.ForeColor = vbBlack
End If

If Me.Auth > Me.Hired Then
Me.Hired.ForeColor = vbRed
Me.Hired.FontBold = True
Else
Me.Hired.ForeColor = vbBlack
Me.Hired.FontBold = False
End If

The one dealing with Auth and Hired works great, but the one dealing with HiredA and ReqA doesn't. All fields have their format set to general number.

Doesn't anyone have any clue why this may not work?

Thanks in advance!
Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

lena.wood@starband.net
 
Hi,
The code looks correct, so it may be the actual data in the table. Can you check this? I usually check my data by sorting the column in question both ascending and descending. HTH, [pc2]
Randy Smith
California Teachers Association
 
Just like the one that works, the fields come from a crosstab query (several crosstab queries joined into one query made into a report).

I have went in and set the ReqA to a number higher than the HiredA just so that I was sure I had some fields that would required the color change. I have checked the names of the fields, even renaming the HiredA from just A (thought maybe that was part of the problem).

What else should I check? I finally figure out how to do soemthing, do it right, and it still will not work! :-(

Thanks for trying. Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

lena.wood@starband.net
 
Ellie,
Let's review the facts, ok?
1) Your first &quot;if&quot; statement works, which means that you all the necessary references enabled.
2) You checked all the necessary field types, and that is correct.
3) The only other possibility has to be the data itself. HTH, [pc2]
Randy Smith
California Teachers Association
 
Randy,

I deleted the fields from my report and put them back on the report and all worked fine.

Thanks for the assistance!
Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

lena.wood@starband.net
 
Not sure what you are wanting.

I have a field that is the number of people required to be here for the plant to run (ReqA) and the number of people that have been hired (HiredA) for 6 shifts (A, B, C, D, Days, Other). If we haven't hired enough people required for our plant to run (we are not live yet) then I want attention drawn to this area...so I have colored the text red. If we have enough (or more than enough) then the text will be black.

Short of doing a screen capture to show you the layout of the report, I am not sure what other information you would like me to give you. Just ask and I will try to provide it for you.
Ellie
**Using Access 97 at work**
**Using Access 2000 at home**

lena.wood@starband.net
 
Disregard - it had posted right after you had got it working
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top