ms/access form conditional format no functioning

On my app I have a multi-record form where I want to highlight the current cell . For this I am using the Conditional Format of ms/access as per the screenshots below

for this, on the cell I am using the conditional formula:

the fields are OK and named:

Me.frm_txtCurrentPaciente - the field in the upper right (form header, stating the current value

Me.frm_idPaciente - the field in the current record

the formula being

but no matter what, the format keeps the same...

can anyone help?
João serras-pereiraAsked:
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.

Can you upload sample DB (only this form and related tables/queries)?
João serras-pereiraAuthor Commented:
sure! I'll do in a few minutes!
Just a note on Syntax... the "Me" prefix is VBA only, and not understood in conditional formatting, queries or form property sheets.  If these are fields, textboxes, or other form controls, try

[frm_txtCurrentPaciente] = [frm_idPaciente]

Open in new window

10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

João serras-pereiraAuthor Commented:
Hi... Not yer but (hopefully) closer.....
now ALL instances are colores. Please check the screenshots

the top right yellow box contains the comparison field..
Ah - are you trying to 'Highlight the current record'?

1.  The textbox in the header section, txtCurrentPaciente, should be unbound (Blank controlsource).
2.  Use VBA code in the form's Current Event to set it's value (you can use the Me prefix here):
Private Sub Form_Current()      
    Me.frm_txtCurrentPaciente = Me.frm_idPaciente
End Sub

Open in new window

3.  In conditional formatting, use the expression (with Brackets and without the Me Prefix):
[frm_txtCurrentPaciente] = [frm_idPaciente]

Open in new window

João serras-pereiraAuthor Commented:
well... this is precisely what I am doing.... the code is:

Private Sub Form_Current()

    Call logMe("Form_Current frm_pacienteLista", "start")
    Me.frm_txtCurrentPaciente = Nz(Me.frm_IDpaciente, "0")
    Forms![_intData].frm_pacienteCurRec = Me.frm_txtCurrentPaciente
    Call logMe("Form_Current frm_pacienteLista", "end")

End Sub
Ok - for your conditional formatting, ensure that you are using the 'name of the field as it appears in your table' and the 'name of the unbound textbox'

[The ID FieldName From Your Table Design] = [The Name Of the Unbound Textbox in Your Form Header]

Open in new window

Take a look at this sample, paying particular attention to the names of the fields in the table design, the name of the text boxes, and how those names are applied in the conditional formatting.

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
João serras-pereiraAuthor Commented:
Fount it!
The problem was that the field in the form header was  BOUND!
João serras-pereiraAuthor Commented:
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.