Help with conditional formatting

Last week an expert helped me with conditional formatting of a text box.  His solution was

https://www.experts-exchange.com/questions/29080620/Make-field-background-yellow-if-the-field-contains.html?anchor=a42448200¬ificationFollowed=203165381#a42448199

But now I need a solution for when there is either [], or [ and any text in beween ].
SteveL13Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

bfuchsCommented:
try instr(YourFieldName,"[")>0 and instr(YourFieldName,"]")>0
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you can also enhance it in existing Expression Conditional Formatting to:

InStr([FirstName],"[")>0 And InStr([FirstName],"]")>0 And InStr([FirstName],"[")<InStr([FirstName],"]")

Open in new window


in case you wish to have a pattern of "[" follow by "]" . in this case "something ] ?? [ whatever " will not be highlighted.
0
Gustav BrockCIOCommented:
Adjust it to for Expression Is  to read:

Left([FirstName],1)="[" And Right([FirstName],1)="]"

Open in new window

0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

SteveL13Author Commented:
bfuchs:  Did not work.
Ryan:  Did not work.  In fact, it locked up the form I'm trying to use it with and the form wouldn't even open,

Gustav:  It worked except where the was [None.] in the field.  ????
0
Gustav BrockCIOCommented:
Strange. Is "None." a field name?
0
SteveL13Author Commented:
No. "Description" is the field name.
0
SteveL13Author Commented:
[None.] was a string of characters in the middle of the text in the field.
0
Gustav BrockCIOCommented:
So "None." is the content?
I have no explanation.
0
Gustav BrockCIOCommented:
Try with these variations:

Left(([Description]),1)="[" And Right(([Description]),1)="]"

Left(Nz([Description]),1)="[" And Right(Nz([Description]),1)="]"

Open in new window

0
SteveL13Author Commented:
Neither worked.  So I took a look at an example Excel file I have.  The conditional formatting that works is:

Cell value contains '[*]'

It looks like the asterisk is a wildcard.  ????
0
Gustav BrockCIOCommented:
That seems better.
I tried with Like "[*]" but that didn't work.
0
SteveL13Author Commented:
So maybe it can't be done in Access?
0
Gustav BrockCIOCommented:
A final attempt:

Hex(Asc([Description])) & Hex(Asc(Right([Description],1)))="5B5D"

Open in new window

0
SteveL13Author Commented:
Sorry.  Not quite.  It worked with this text in the entire field:

[Provide 2" thick rigid insulation 2' wide at perimeter.] [None.]

But not with:

Saw-cut [Troweled] [Pre-formed] joints at 25' [20'] centers, 600 SF max area. Depth of joints to be 1/4 of slab thickness.
0
Gustav BrockCIOCommented:
But that is correct as to your definition:

when there is either [], or [ and any text in beween ].

In your last example, text follows the trailing "]"
0
SteveL13Author Commented:
I'm sorry.  My definition was incorrect.  It has to format anytime there is a [ and a ] anywhere in the text field.  Sometimes they'd be together.  Sometimes separated by text.  Sometimes multiple "sets" in the field.  Confusing.
0
Gustav BrockCIOCommented:
OK. Then Ryan's (reduced) method should work:

InStr([Description],"[")>0 And InStr([Description],"]")>InStr([Description],"[")

Open in new window

0

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
SteveL13Author Commented:
Ryan's did not work as presented.  Your suggestion does work.
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
Ryan's did not work as presented.  Your suggestion does work.
it actually works well for me.



same condition:

InStr([FirstName],"[")>0 And InStr([FirstName],"]")>0 And InStr([FirstName],"[")<InStr([FirstName],"]")

Open in new window


or I missing something here?
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.