Help with VB Code please!? VERY URGENT! JUST A QUICK THING! IF..ELSE...

Status
Not open for further replies.

bilal_zd

Beta member
Messages
1
Can somebody tell me if this makes sense please, I need it URGENTLY PLEASE....I am trying to put the "false" value as another IF function, if that makes sense? I just need to know it is ok? It is really for a certain grade function, so that my system can display a grade of, A, B, C, D, E, U...depending on what the "total mark" is. If it doesn't...how would it be done? Thankyou:


If [Total_Mark] < 40 Then
result = "U"

Else

If [Total_Mark] < 50 Then
result = "E"

Else

If [Total_Mark] < 60 Then
result = "D"

End If




Please can somebody help! Thankyou! The code will keep goin onto 80 marks, and to grade A, but I left it at grade D for the purpose of not making this thread too big! Thanks in advance, need it in next few hours please! Thanks!
 
hm.... im not a VB buff yet... starting that next year...

but if it were similar to php then you should put it in some kind of thing like the switch command... here is an example

in PHP, $x signifies "variable x"
echo = print, printf, cout, etc (print on screen)

Code:
$destination = "Tokyo";
echo "Traveling to $destination
";   //"traveling to tokyo"
switch ($destination){
    case "Las Vegas":                        //if it is $destination = las vegas
         echo "Bring an extra $500";    //bring extra money
         break;                                      //end case 1
     case "Amsterdam":                      // etc
         echo "Bring an open mind";
         break;
     case "Egypt":
         echo "Bring 15 bottles of SPF 50 Sunscreen";
         break;
     case "Tokyo":
         echo "Bring lots of money";
         break;
     case "Caribbean Islands":
         echo "Bring a swimsuit";
         break;
}

or, if you could say in VB something like

Code:
if 0 < [Total_Mark] < 40   #if Total_Mark = 0-40...
result = "U"                      #result = U

and just skip out on the Else's

however, again, i dont know VB really... i've only played with it and made stupid windows and stuff
 
Status
Not open for further replies.
Back
Top Bottom