View Full Version : Wildcards for Conditional Formatting of a text box in a report


Gordon
09-20-2007, 04:29 PM
I have a text box in the page header for a report.

I want to apply conditional formatting to whenever the word "overdue" comes up in that text box.

If I type in the full text for one possible variation, then it works for that variation (i.e. "Overdue from Author). However, I want to have it conditionally format for "Overdue for publishing" or any other variation.

I have tried "*overdue* and *&overdue&*. Neither works.

Any suggestions?

ajetrumpet
09-21-2007, 07:21 AM
If I type in the full text for one possible variation, then it works for that variation (i.e. "Overdue from Author). However, I want to have it conditionally format for "Overdue for publishing" or any other variation.Gordon, are you writing the conditional formatting statement in a module?? I think wildcards work the same there...?? if me.control LIKE '"*" & "Overdue"', then...

Gordon
09-21-2007, 07:26 AM
Gordon, are you writing the conditional formatting statement in a module?? I think wildcards work the same there...?? if me.control LIKE '"*" & "Overdue"', then...

Thanks for the response. I haven't worked with modules, I'm doing this in the standard interface for conditional formatting FORMAT/Conditional Formatting...... I was hoping to find a solution that works in that venue.

Gordon

ajetrumpet
09-21-2007, 07:49 AM
I'm not even sure how many formatting options it gives you, but I know it does give the true/false option.

I bet you it wouldn't take very long to write a short sub giving the conditions and the formats to use in VB. You could use If, Then, ElseIf....or maybe even SELECT CASE.

Might want to try it, you could learn something interesting about coding in the process too. :)

pvs
09-24-2007, 02:50 PM
Not sure if this will work for you, but there is a formula named InStr() that might work: If InStr(STRINGEXP,'OVERDUE')>0

InStr() returns the starting location of str2 within within str1, so 0 means str2 isn't in str1 ... any other value means it is. If you need to worry about case, simply convert both using UCase().

-pvs

ajetrumpet
09-25-2007, 08:05 AM
there is a formula named InStr() that might workInstr() is a function. ;)

pvs
09-25-2007, 02:02 PM
Instr() is a function. ;)

Ahhh yes. THAT'S the word I was looking for. Did you ever have 'one-of-those-moments' where you couldn't find the right word? ;)

So sorry if my reply was confusing to anyone.

-pvs