If statements based on criteria

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
 
W

Wayne Morgan

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")))
 
A

Antonio

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",
 

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