HELP: Conditional/Automatic Outputs

T

Tim

Access 2000

In on of my tables I have a entry for a score [X:50]. The score corresponds
with a specific title:

X<35 = FAILED
34<X<45 = NOVICE
44<X<48 = INTERMEDIATE
X>47 = EXPERT

I currently have a seperate column in a table for the titles; is there a way
to set up a text box in a report with conditional formatting or some other
way
to output the title based on the number ranges I have provided?
 
T

Todd Shillam

Tim,

You can hard-code values to an added unbound textbox. For example, you could
hide your score field (visible = false), then program the unbound textbox's
default value (using a report event, such as OnPrint) to the value based on
your hidden score field.

If Me![score] = 35 Then
Me![txtBox] = FAILED
Else
If (Me![score] > 35) AND (Me![score] < 45)
Me![txtBox] = NOVICE
Else
'YOUR CODE HERE
End If
End If

Best regards,

Todd
 
J

John Vinson

Access 2000

In on of my tables I have a entry for a score [X:50]. The score corresponds
with a specific title:

X<35 = FAILED
34<X<45 = NOVICE
44<X<48 = INTERMEDIATE
X>47 = EXPERT

I currently have a seperate column in a table for the titles; is there a way
to set up a text box in a report with conditional formatting or some other
way
to output the title based on the number ranges I have provided?

Two suggestions: one easy, one more work but more flexible and easier
to maintain:

1. Set the Control Source of a textbox to

=Switch([X] < 35, "Failed", [X] < 45, "Novice", [X] < 48,
"Intermediate", [X] > 47, "Expert", True, "(No Score Entered)")

2. Set up a small Rating table with two fields, the threshold score
and the rating for that score; create a Query joining it to your table
with a "non equi join" query.

John W. Vinson[MVP]
 
Top