store "switch expression" result created in a form for report use

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My first time using "switch" - Created a form & entered score in one column
and using "switch expression" converted next column to display a level based
on score. The level does not display in my table. How do you store the
"switch expression" result in the table for future use on a report?
 
With a few exceptions, don't. Just calculate the value in the report or in
the query feeding the report. You should be able to calculate the value in
the report just as you did on the form.
 
My first time using "switch" - Created a form & entered score in one column
and using "switch expression" converted next column to display a level based
on score. The level does not display in my table. How do you store the
"switch expression" result in the table for future use on a report?

You don't.
Just store the score value.
Then use the same expression that you used on the form or query in an
unbound control on the report:
= Switch(FieldName >= 90,"A", FieldName >=80 and FieldName <90,"B",
etc...)

You might also want to consider Choose, IIf, or Select Case, If ..
Then .. Else, depending upon what your actual data is.
The first 2 can be done directly in a form, report or query. The last
2 are done in VBA
 
Back
Top