Conditonal format on sub-form based on who is logged onto the form

Sandra Smith
Sandra Smith used Ask the Experts™
on
I have an ACCESS 2003 forms/subform. However, depending on who is logged in, I need the Created_By field in the subform to be red/yellow.  That is, if the person using the form is Sarah and a field in the subform is also Sarah, I need the field on the subform to be red/yellow.  I am in the COnditonal formatting dialog box and assume it would be an experssions, but not sure how to write it.

Sandra
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database Architect / Application Developer
Top Expert 2007
Commented:
Something like this - assuming by 'logged in' you mean the Windows User Name ?

cf
mx
Capture1.gif
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
<No points wanted, just a note>
As your users grow, note that CF has a max of 3 conditions by default.

There are ways around this, of course.
I am sure MX can guide you through...

;-)

Jeff
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
"As your users grow, note that CF has a max of 3 conditions by default."
Good news is that A2010 has lifted that limit ...

mx
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Ah, ...never noticed that...

;-)

Jeff
Sandra SmithRetired

Author

Commented:
Yes, i am so hoping they go to 2010!  

Now, DatabaseMX, I am going to try your suggestion and yes, I mean Windows Login.  This is a form/subform so I hope it works.  Something like Me.Parent.txtUserID.

Sandra
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
Also ... the CF dialog (designer) is MUCH nicer in A2010 -

OK ,.. it should work. After which, we will replace Environ() with something better.

mx
Sandra SmithRetired

Author

Commented:
Yes that did it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial