Case Statement

L

LilP

In my table the users are entering numbers in a field ( 1 - 5) which
represent ratings such as "Poor" and "Good". I want the information to
display as text...

If 1 then "Poor" - I think on the table I can write the expression in the
Default Value property - Is that right? Also what is the actual code to get
it to work?
 
K

KARL DEWEY

You could build a bunch of nested IIF statements but better is a translation
table.
Ratings ---
Rate - number - integer ( 1 - 5 )
Rating - text ( Poor through Good based on the number in Rate field.

In your query left join the data table rating field to the translation table
Rate field. Put Rating field in the field row of the grid.
 
J

jon

You can create a query from the table, with an expression such as

IIF([RATING] =
1,"POOR",IIF([RATING]=2,"BAD",IIF([RATING]=3,"AVERAGE",IIF([RATING]=4,"GOOD",IIF([RATING]=5,"EXCELLENT","UNKNOWN
RATING")))))

Hope it helps

Jon
 
P

Pat Hartman

Create a combobox. Select ValueList as the RowSourceType and enter your
value list in the RowSource property
1;"Poor";2;"step2";3;"step3";4;"step4";5;"Good"

Set the
ColumnCount to 2
ColumnWidths to 0";2"

No code required :)
 
Top