expression for contains

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?
 
M

Marshall Barton

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*"
 
R

Rose

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*"
 
J

John Spencer

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
 
G

Gina Whipp

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*"
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top