change name of criteria

  • Thread starter Thread starter JRS
  • Start date Start date
J

JRS

Hi,

One of the fields in my query is called Type. There are numerous acceptable
values for Type....2 of which are lemon and grapefruit as you see below. I
have the below as my cirteria to just pull these items but rather than
display as lemon and grapefruit in the worksheet view....I want that to
display as yellow. How do I do that? thank you



"Lemon" Or "Grapefruit"
 
Hi,

One of the fields in my query is called Type.  There are numerous acceptable
values for Type....2 of which are lemon and grapefruit as you see below.  I
have the below as my cirteria to just pull these items but rather than
display as lemon and grapefruit in the worksheet view....I want that to
display as yellow.  How do I do that?  thank you

"Lemon" Or "Grapefruit"

i am assuming you dotn want them to be the colour yellow and want them
to be the word yellow for that you need to use an expression you have
a field in the query type and its criteria is "Lemon" Or "Grapefruit"

now

click the exclude box on that field to hide it and in a empty field
type

typecolour: iif([type] = "Lemon" or [type] = "Grapefruit", "yellow",
[type])

and if you want to have other fruite liek that as well you can nest
your iifs

typecolour: iif([type] = "Lemon" or [type] = "Grapefruit", "yellow",
iif([type] = "Apple", "Red",[type]))

hope this helps
 
Hi,

One of the fields in my query is called Type. There are numerous acceptable
values for Type....2 of which are lemon and grapefruit as you see below. I
have the below as my cirteria to just pull these items but rather than
display as lemon and grapefruit in the worksheet view....I want that to
display as yellow. How do I do that? thank you

"Lemon" Or "Grapefruit"

1) So you only wish to return records that contain 'Lemon' or
'Grapefruit' in the Type field and instead of Lemon or Grapefruit have
it say Yellow.
Since every record returned will be either Lemon or Grapefruit, all
you need do, in a query, is add a new column.

NewTypeColumn:"Yellow"

Every record returned will have Yellow in this column.

2) Type is an Access Property and is a reserved Access/VBA/Jet word
and should not be used as a field name.

i would suggest you change that field name to something else, as you
may get unintended results.

For a more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html
 
Back
Top