Private Sub login_Click()
Dim sql1 As String
If Nz(Me.namein) <> "" Then
If isnull(DLookup("姓名", "表2", "姓名='& me.namein.value &'")) Then
MsgBox "该用户名不存在,请重新输入"
Me.namein = ""
Exit Sub
Else
sql1 = "select [密码] from [表2] where [姓名]='& me.namein.value &'"
If sql1 = "& me.password.value &" Then
MsgBox "欢迎登陆"
Else
MsgBox "密码错误"
Me.password = ""
End If
End If
Else
MsgBox "请输入用户名!", vbQuestion
End If
End Sub 作者: williamwangc 时间: 2011-7-6 23:14 本帖最后由 williamwangc 于 2011-7-6 23:20 编辑