If statements based on criteria

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

I have a report that is based on a parameter query. At
the report header is a text box that displays the
criteria the user entered into the prompt. Is it possible
to use the reports "on open" event to display one of
three statements based on the value in a particular text
box?

Example:
a = 8pm report
b = 9pm report
c = 10 pm report

User types in a, b, or c, depending on what time of the
day it is.
When the report prints out, at its header text
box "ReportId" displays what the user entered.
Can a seperate text box at the reports header be made to
display "8pm", "9pm", or "10pm" based on which letter is
in the "ReportId" text box?
TIA
 
It would probably be easiest to use an IIF statement in the textbox's
Control Source.

=IIf(HeaderTextbox="a", "8pm report", IIf(HeaderTextbox="b", "9pm report",
IIf(HeaderTextbox="c", "10pm report", "Error")))
 
You are awsome wayne, thank you so much!

-----Original Message-----
It would probably be easiest to use an IIF statement in the textbox's
Control Source.

=IIf(HeaderTextbox="a", "8pm report", IIf
(HeaderTextbox="b", "9pm report",
 
Back
Top