txtPassword.SetFocus Exit Sub
ElseIf txtPwAgain.Text = "" Then
MsgBox "请填写确认密码!", vbOKOnly + vbInformation, "注意" txtPwAgain.SetFocus Exit Sub End If
If txtPassword.Text <> txtPwAgain.Text Then
MsgBox "两次密码不相同,请重新填写!", vbOKOnly + vbInformation, "注意" txtPassword.Text = "" txtPwAgain.Text = "" txtPassword.SetFocus Exit Sub End If
On Error GoTo exit1
If Not IsExistUser(txtUserName, "") Then '添加用户
DataE.cmdAdd txtUserName, txtPassword, txtRealname, txtUnit, Now, udAge, Usertype, State
MsgBox "注册成功!", vbOKOnly + vbInformation, "注意" Unload Me
frmSearch.Show Else
MsgBox "用户已经存在!请重新注册一个新的用户名", vbOKOnly + vbInformation, "注意"
txtUserName.Text = "" txtPassword.Text = "" txtPwAgain.Text = "" txtUserName.SetFocus End If Exit Sub exit1:
MsgBox "数据未成功写入数据库!", vbOKOnly + vbInformation, "错误" Exit Sub End Sub