if Statement code

G

ghost

Greeting,
I have a report which shows Students marks, in this report there is 5 fields
for Subjects and one for Total. There is one more unbound text box for
showing the progress. What I need to do is if the total text has grade <=39.9
than unbound text value = failed and with red color. If total between 40 and
49.9 than the good, if total between 50 and 59.9 than very good, if total
between 60 and 70 than excellent else out standing
How can I do that??
Thank you
 
F

fredg

Greeting,
I have a report which shows Students marks, in this report there is 5 fields
for Subjects and one for Total. There is one more unbound text box for
showing the progress. What I need to do is if the total text has grade <=39.9
than unbound text value = failed and with red color. If total between 40 and
49.9 than the good, if total between 50 and 59.9 than very good, if total
between 60 and 70 than excellent else out standing
How can I do that??
Thank you

Note: If [Total] is a calculated value, then it should not be a field
at all. It should be an unbound control on your form or report.

As control source in an Unbound control in your report:
=IIf([SomeControl]<=39.9,"Failed",IIf([SomeControl]>=40 and
[SomeControl]<-49.9,"Good",IIf([SomeControl]>=50 and
[SomeControl]<=59.9,"Very Good","Excellent")))

To display the "Failed" in a different color, use the control's
Conditional Formatting property.
Set Condition1 to Field Value Is.
enter <=39.9
Set the color to Red.
 

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