|
Sub login()
'===用户登陆===
On Error GoTo doerror
sname = UserForm1.TextBox1.Text
spass = UserForm1.TextBox2.Text
If sname = "" And spass <> "" Then
MsgBox ("请输入用户名")
UserForm1.TextBox1.Text = ""
UserForm1.TextBox2.Text = ""
UserForm1.TextBox1.SetFocus
ElseIf spass = "" And sname <> "" Then
MsgBox ("请输入密码")
UserForm1.TextBox2.Text = ""
UserForm1.TextBox2.SetFocus
ElseIf sname = "" And sname = "" Then
MsgBox ("请输入用户名和密码")
UserForm1.TextBox1.Text = ""
UserForm1.TextBox2.Text = ""
GoTo jixu
doerror:
'查找出错时,说明无效用户
MsgBox "无此用户,请查实!", vbOKOnly, "系统提示"
UserForm1.TextBox1.Text = ""
UserForm1.TextBox2.Text = ""
UserForm1.TextBox1.SetFocus
|
|