Yep doggle is right .you are missing two end if as well .
Code:
Option Explicit
Dim score As Integer
Private Sub Command1_Click()
Dim Values(3) As ColorConstants
Values(0) = vbRed
Values(1) = vbBlue
Values(2) = vbGreen
Dim RandomNumber As ColorConstants
RandomNumber = Values(Rnd * 2)
Label1.BackColor = RandomNumber
Randomize
End Sub
Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Text1.Text = Label1.BackColor = Values(0) Then
score = score + 1
Label3.Caption = score
End If
If Text1.Text = Label1.BackColor = Values(1) Then
score = score + 1
Label3.Caption = score
End if 'End if Needs to be here
If Text1.Text = Label1.BackColor = Values(2) Then
score = score + 1
Label3.Caption = score
End if 'Endif needs to be here
End Sub
Private Sub Form_Load()
Label2.Caption = "the color is:"
Text1.Text = ""
Label4.Caption = "score:"
Label1.Caption = ""
Command2.Caption = "submit"
End Sub