【发布时间】:2016-09-28 15:32:16
【问题描述】:
我不断收到类型不匹配错误,我不确定自己做错了什么。
这是我迄今为止尝试过的:
Private Sub Command1_Click()
Dim UserLevel As Integer
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter Login ID", vbInformation, "Login ID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
If (IsNull(DLookup("UserLogin", "Accounts", "UserLogin='" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "Accounts", "Password='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect Login ID or Password"
Else
UserLevel = DLookup("UserSecurity", "Accounts", "UserLogin= '" & Me.txtLoginID.Value & "'")
DoCmd.Close
If UserLevel = admin Then
DoCmd.OpenForm "Administrator"
Else
DoCmd.OpenForm "Sales"
End If
End If
End If
【问题讨论】:
-
哪一行报错?