expression for contains

  • Thread starter Thread starter Rose
  • Start date Start date
R

Rose

When doing a conditional formatting in a report and you want to type the
expression contains "USA" in data for the field of [Country]. What
expression would you use?
 
Rose said:
When doing a conditional formatting in a report and you want to type the
expression contains "USA" in data for the field of [Country]. What
expression would you use?


You can use the Expression Is option with an expression like
either:
InStr([field], "USA") > 0
or
[field] Like "*USA*"
 
I tryed to input the expression in the Conditional Formatting Field under
Condition 1 but it does not seem to work any ideas?
--
Rose


Marshall Barton said:
Rose said:
When doing a conditional formatting in a report and you want to type the
expression contains "USA" in data for the field of [Country]. What
expression would you use?


You can use the Expression Is option with an expression like
either:
InStr([field], "USA") > 0
or
[field] Like "*USA*"
 
Did you include the brackets around the FIELD name? You must do so or the
expression will compare the string "Country to the string "*USA*" and always
return false.

"Country" Like "*USA*"
when you want
[Country] Like "*USA*"

Also make sure you have the field Country in the record source for the report
and that the field is named Country.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Rose,

I just tested mine and it works... did you try it?

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Rose said:
I tryed to input the expression in the Conditional Formatting Field under
Condition 1 but it does not seem to work any ideas?
--
Rose


Marshall Barton said:
Rose said:
When doing a conditional formatting in a report and you want to type the
expression contains "USA" in data for the field of [Country]. What
expression would you use?


You can use the Expression Is option with an expression like
either:
InStr([field], "USA") > 0
or
[field] Like "*USA*"
 
Rose said:
I tryed to input the expression in the Conditional Formatting Field under
Condition 1 but it does not seem to work any ideas?


Also make sure you selected the Expression Is option.
 
Back
Top