If statement neeeded for column in Access Query

ExampleI need an IF statement with the following logic:

"If the contents of a column's header are not shown in the column then sort it's items to the top, and color the cell orange."
frugalmuleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PatHartmanCommented:
This is Access, NOT Excel.  Queries are for selecting/operating on data.  Reports are for displaying data.  Forms are primarily used for data entry but also can display data for some purposes.

I don't understand your statement - "if the contents of a column's header".  Headers are a label.  They are not data unless perhaps you are using Excel in which case row 1 which contains the column headers is just another row.  In a relational database, the column names are not part of the data returned by the recordset.  They are the names of objects.

You can use the IIf() function in queries to "calculate" values on which you can sort and group but coloration can't be applied in a query.  You must use conditional formatting on a control in a report or form.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
"If the contents of a column's header are not shown in the column then sort it's items to the top, and color the cell orange."
This statement makes no sense in terms of a Database table...
I am not even sure what this would look like...

As Pat states plainly, you are using Access incorrectly.
(Or perhaps Access is not the tool you should be using)

I think your question should be: "Have i designed this system correctly"?
...Then take a step back and explain to us, (in detail with an actual user scenario) what you are trying to accomplish here.

Perhaps there is a better approach...

JeffCoachman
0
PatHartmanCommented:
Did Jeff give you some answer that is not visible here?
0
Jeffrey CoachmanMIS LiasonCommented:
frugalmule,

I am not sure what happened here, ...but my post should not be considered as a "solution"
1. I reiterated what Pat said
2. I requested additional information...

I have requested that this Q be re-opened so that we can work towards a solution.
0
frugalmuleAuthor Commented:
This reply helps me understand where I went wrong.  I don't know whether I will have time to revisit the problem I was having when I asked it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.