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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using conditional formatting

Status
Not open for further replies.

Potatohead123

Technical User
May 2, 2005
5
0
0
CA
Hi all,

I'm a beginner. In MS Access, I want to turn a textfield into a different color when a numerical value in the textfield is greater than the average (this average is obtained using a query - from tables).

The query is:
SELECT Round(Avg(nz([tbl_x]![fld_x_Successful_Today],0)+nz([tbl_x]![fld_x_Successful_Yesterday],0)),0) AS Avg_Success,
FROM tbl_x
WHERE (((Format([fld_date],"ddd"))=[Please enter the day <ddd>]));

I know I need to use the expression in "conditional formatting", but I do not know how to write it.

Notice that in the query, it takes the day of week (ie. Mon)that the user enters and evaluate the average. (ie. the average successes of all mondays).

In Access, the day of the week should be figured out automatically.. somehow.. so that the user wouldn't have to enter day of week.

Can someone lead me the way... I am so confused. What should I do first? and how? Please let me know if I am not clear enough.. and I will elaborate.
 
I've done something like that recently, what I did was this. Create a hidden field with a control source that was set to a function which evaluated to True or False. Then set conditional formatting of the textfield to change colour using:
Expression Is [Invisible_Field]
Simon Rouse
 
Hi All,

I have an Excel spreadsheet with the following conditional formatting set in a macro. When this macro runs it highlights fields that are null. How can I only highlight those fields that are populated? Here is what we have:

Columns("H:H").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
Formula1:="3.5"
Selection.FormatConditions(1).Interior.ColorIndex = 36

Thank you for your help!

Sandy
 
Sandy
This is a completly different problem in Excel and should really go into the VAB or Office fora. My method above works in Access by a pretty obscure cross reference and I can't see that it could apply for you in Excel. But I admit I'm no Excel expert
Simon Rouse
 
Sorry about that. I meant for this to be a new post and not a tag onto where I placed it. Sorry...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top