I am new to Visual Basic and I am having a difficulty setting multiple strings of If/Then statements for a command buttons click procedure. I know I must be missing something or have something in the wrong order. The first set of if statements works fine but my second set gives me a "Compile error: End If without Block If". As I have all my If's paired with then's and end if's, I don't understand what is wrong. Maybe one of you experts out there can take a look at the following code and give me some advice (Please O Please) <br>
<br>
If you need to know anything else about what I am trying to accomplish here just drop me a line.<br>
<br>
Thanks,<br>
Aleena<br>
<br>
Private Sub cmdComputate_Click()<br>
picScore.Cls<br>
picGrade.Cls<br>
<br>
x = 0<br>
<br>
If cboScore1.Text <> "N/A" Then<br>
A = Val(cboScore1.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore2.Text <> "N/A" Then<br>
b = Val(cboScore2.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore3.Text <> "N/A" Then<br>
c = Val(cboScore3.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore4.Text <> "N/A" Then<br>
d = Val(cboScore4.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore5.Text <> "N/A" Then<br>
e = Val(cboScore5.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore6.Text <> "N/A" Then<br>
f = Val(cboScore6.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore7.Text <> "N/A" Then<br>
g = Val(cboScore7.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore8.Text <> "N/A" Then<br>
h = Val(cboScore8.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore9.Text <> "N/A" Then<br>
j = Val(cboScore9.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore10.Text <> "N/A" Then<br>
k = Val(cboScore10.Text)<br>
x = x + 50<br>
End If<br>
<br>
If cboScore11.Text <> "N/A" Then<br>
m = Val(cboScore11.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore12.Text <> "N/A" Then<br>
n = Val(cboScore12.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore13.Text <> "N/A" Then<br>
p = Val(cboScore13.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore14.Text <> "N/A" Then<br>
r = Val(cboScore14.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore15.Text <> "N/A" Then<br>
s = Val(cboScore15.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore16.Text <> "N/A" Then<br>
t = Val(cboScore16.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore17.Text <> "N/A" Then<br>
u = Val(cboScore17.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore18.Text <> "N/A" Then<br>
v = Val(cboScore18.Text)<br>
x = x + 10<br>
End If<br>
<br>
z = A + b + c + d + e + f + g + h + j + k + m + n + p + r + s + t + u + v<br>
q = (100 * z) \ x<br>
<br>
(Right here is where my problem develops)<br>
<br>
If q >= 93 Then picGrade.Print "A"<br>
End If<br>
<br>
If q >= 90 Then picGrade.Print "A-"<br>
End If<br>
<br>
If q >= 88 Then picGrade.Print "B+"<br>
End If<br>
<br>
If q >= 82 Then picGrade.Print "B"<br>
End If<br>
<br>
If q >= 80 Then picGrade.Print "B-"<br>
End If<br>
<br>
If q >= 78 Then picGrade.Print "C+"<br>
End If<br>
<br>
If q >= 72 Then picGrade.Print "C"<br>
End If<br>
<br>
If q >= 70 Then picGrade.Print "C-"<br>
End If<br>
<br>
If q >= 68 Then picGrade.Print "D+"<br>
End If<br>
<br>
If q >= 62 Then picGrade.Print "D"<br>
End If<br>
<br>
If q >= 60 Then picGrade.Print "D-"<br>
End If<br>
<br>
If q >= 1 Then picGrade.Print "F"<br>
End If<br>
<br>
picScore.Print q<br>
<br>
<br>
End Sub
<br>
If you need to know anything else about what I am trying to accomplish here just drop me a line.<br>
<br>
Thanks,<br>
Aleena<br>
<br>
Private Sub cmdComputate_Click()<br>
picScore.Cls<br>
picGrade.Cls<br>
<br>
x = 0<br>
<br>
If cboScore1.Text <> "N/A" Then<br>
A = Val(cboScore1.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore2.Text <> "N/A" Then<br>
b = Val(cboScore2.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore3.Text <> "N/A" Then<br>
c = Val(cboScore3.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore4.Text <> "N/A" Then<br>
d = Val(cboScore4.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore5.Text <> "N/A" Then<br>
e = Val(cboScore5.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore6.Text <> "N/A" Then<br>
f = Val(cboScore6.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore7.Text <> "N/A" Then<br>
g = Val(cboScore7.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore8.Text <> "N/A" Then<br>
h = Val(cboScore8.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore9.Text <> "N/A" Then<br>
j = Val(cboScore9.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore10.Text <> "N/A" Then<br>
k = Val(cboScore10.Text)<br>
x = x + 50<br>
End If<br>
<br>
If cboScore11.Text <> "N/A" Then<br>
m = Val(cboScore11.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore12.Text <> "N/A" Then<br>
n = Val(cboScore12.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore13.Text <> "N/A" Then<br>
p = Val(cboScore13.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore14.Text <> "N/A" Then<br>
r = Val(cboScore14.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore15.Text <> "N/A" Then<br>
s = Val(cboScore15.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore16.Text <> "N/A" Then<br>
t = Val(cboScore16.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore17.Text <> "N/A" Then<br>
u = Val(cboScore17.Text)<br>
x = x + 10<br>
End If<br>
<br>
If cboScore18.Text <> "N/A" Then<br>
v = Val(cboScore18.Text)<br>
x = x + 10<br>
End If<br>
<br>
z = A + b + c + d + e + f + g + h + j + k + m + n + p + r + s + t + u + v<br>
q = (100 * z) \ x<br>
<br>
(Right here is where my problem develops)<br>
<br>
If q >= 93 Then picGrade.Print "A"<br>
End If<br>
<br>
If q >= 90 Then picGrade.Print "A-"<br>
End If<br>
<br>
If q >= 88 Then picGrade.Print "B+"<br>
End If<br>
<br>
If q >= 82 Then picGrade.Print "B"<br>
End If<br>
<br>
If q >= 80 Then picGrade.Print "B-"<br>
End If<br>
<br>
If q >= 78 Then picGrade.Print "C+"<br>
End If<br>
<br>
If q >= 72 Then picGrade.Print "C"<br>
End If<br>
<br>
If q >= 70 Then picGrade.Print "C-"<br>
End If<br>
<br>
If q >= 68 Then picGrade.Print "D+"<br>
End If<br>
<br>
If q >= 62 Then picGrade.Print "D"<br>
End If<br>
<br>
If q >= 60 Then picGrade.Print "D-"<br>
End If<br>
<br>
If q >= 1 Then picGrade.Print "F"<br>
End If<br>
<br>
picScore.Print q<br>
<br>
<br>
End Sub