Dim uname As String, vcode As Integer
uname = Text1.Text
psd = Text2.Text
vcode = Val(Text3.Text)
If vcode <> Val(Label4.Caption) Then
Label5.Caption = "验证码有误"
ElseIf uname <> "admin" Or psd <> "p@$$word" Then
Label5.Caption = "用户名或密码有误"
Else
Label5.Caption = "验证成功!"
End If
共有两个地方写错, 一个是 Label4, 一个是 ElseIf
你的 elseif 拼错了吧