ACCESS account

P

problem

I want to make a calculating machine.

IF i have a score, i want this value become a string

e.g.
if [num]>80 and <100 = "A"
if [num]>70 and <79 = "B"
..
..
..
how to make the string out ?
 
P

problem

Thanks of lot

i understand your code. But the "A" can't appear in the box......

you give my website, i dun know what program should download....
coz my English is very poor~~


Arvin Meyer said:
The short way is to use the Immediate If function:

IIf([Num]>80 And [Num]<100,"A",IIf([Num]>70 And [Num]<79,"B","C"))
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

problem said:
I want to make a calculating machine.

IF i have a score, i want this value become a string

e.g.
if [num]>80 and <100 = "A"
if [num]>70 and <79 = "B"
.
.
.
how to make the string out ?
 
J

John Vinson

I want to make a calculating machine.

IF i have a score, i want this value become a string

e.g.
if [num]>80 and <100 = "A"
if [num]>70 and <79 = "B"
.
.
.
how to make the string out ?

Here is one suggestion:

In the Control Source property of the textbox in which you want to see
"A" or "B", put

=Switch([num] > 80, "A", [num] > 70, "B", [num] > 60, "C", [num] > 50,
"D", True, "F")

It may be better to create a Table with the scores and grades, but the
query to link this table can be somewhat difficult.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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