我的访问数据库上有一个用户登录表单,其中包含用户表和其他用户标准。一个是一个复选框,如果" true"将在运行以下代码时打开更改密码表单。但是当此复选框字段返回true时,访问2010崩溃。到目前为止,谷歌已经空手而归。关于什么会导致崩溃的任何想法?它是代码中的东西,还是#34;更改密码"形成?当我通过"双击"手动打开它时,表单打开就可以了。它
'Check if password needs to be reset
If Me.cboUser.Column(3) = True Then
DoCmd.OpenForm "frmPasswordChange", , , "UserID = " & Me.cboUser
End If
整个代码是这样的:
Private Sub txtPassword_AfterUpdate()
'Check that EE is selected
If IsNull(Me.cboUser) Then
MsgBox "You need to select a user!", vbCritical
Me.cboUser.SetFocus
Else
'Check for correct password
If Me.txtPassword = Me.cboUser.Column(2) Then
'Check if password needs to be reset
If Me.cboUser.Column(3) = True Then
DoCmd.OpenForm "frmPasswordChange", , , "UserID = " & Me.cboUser
End If
DoCmd.OpenForm "Opening Screen"
Me.Visible = False
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO tblAuditTrail ([DateTime], UserName, Action) VALUES (Now(),'" & Me.cboUser.Column(1) & "','Login')")
DoCmd.SetWarnings True
Else
MsgBox "Password does not match, please re-enter!", vboOkOnly
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
End If
End Sub