Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"If" functions in reports.. 1

Status
Not open for further replies.

OAKLEYS21

MIS
Jun 28, 2004
20
CA
I was wandering if the "If" function can be used in reports. I want to display some text if the value in one field in the report is true. Can anyone help me thanks. This site is awesome!!
 
Yes, a condition statement for a text box can certain perform what you have described. If you post some more particulars like field names, values, and what you want displayed I can help you with setting that up.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I have the same question. I am doing a book-list report for students at a high school. I need to have different fees listed on the page footer depending on the student's grade level. The field I want to test is called "Grade Level Now". If it =12 then I want a set of 2 or 3 fees to show in a column on the page footer. If =11 I need different set of fees. Any help would be much appreciated.
 
Because you have more than two grades to evaluate I would use the Switch function here rather than IIF. Here is an example of how the Switch works. Create 3 textboxes in a column in your footer and then use the following to fill them with values:

Code:
=Switch(Me.[Grade Level Now] = 12, [i]fee value1[/i], Me.[Grade Level Now] = 11, [i]fee value2[/i], Me.[Grade Level Now] = 10, [i]fee value3[/i], Me.[Grade Level Now] = 9, [i]fee value4[/i])

Now you would do this for each of the textboxes in the footer.

Instead of using an IIF or a Switch Function statement it might be better to create a table with 4 records, one for each grade. Also, include the appropriate fees for each grade. You could then perform a dlookup for each textbox and pull in the correct values.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top