Hi,
I am trying to get details of user security on password reset form and it occur the following errors
before update cboLoginID if i click btnSubmitLoginID it give error
"Type mismatch"
after update cboLoginID if i click btnSubmitLoginID it give error
"running time error 3707 The Microsoft access engine doesnt recognized the value (i select from cbologinID) as a valid field name or expression.
after update of cboLoginID i want all fields that i have on form from tblUsersecurity should show records of that loginID.
my code is below.
The code area i have highlited in red is causing the problem, and for your information i am using access 2010.
Your kind help will be appreciated.
thanks.
I am trying to get details of user security on password reset form and it occur the following errors
before update cboLoginID if i click btnSubmitLoginID it give error
"Type mismatch"
after update cboLoginID if i click btnSubmitLoginID it give error
"running time error 3707 The Microsoft access engine doesnt recognized the value (i select from cbologinID) as a valid field name or expression.
after update of cboLoginID i want all fields that i have on form from tblUsersecurity should show records of that loginID.
my code is below.
Code:
Option Compare Database
Option Explicit
Private saved As Boolean
Private Sub BtnResetPassword_Click()
saved = True
DoCmd.RunCommand (acCmdSaveRecord)
Me.BtnResetPassword.Enabled = False
saved = False
End Sub
Private Sub BtnSubmitLoginID_Click()
On Error GoTo errhandlers:
'Check to see if data is entered into the txtLoginID text box.
If IsNull(Me.cboLoginID) Or cboLoginID = "" Then
MsgBox "You must enter a User Name !", vbOKOnly, "Required Data", vbInformation, "Login Verification"
Exit Sub
End If
If DCount("[LoginID]", "tblUserSecurity", "[LoginID]=" & Me.cboLoginID) > 0 Then
MsgBox "Entered Login details are not matching with registered user, please provide correct login ID !", vbInformation, "Login Verification"
Exit Sub
End If
exit_errhandlers:
Exit Sub
errhandlers:
MsgBox Err.Description, vbCritical
Err.Clear
End Sub
Private Sub cboLoginID_AfterUpdate()
[COLOR="Red"]Me.Recordset.FindFirst "LoginID = " & Nz(cboLoginID, 0)[/COLOR]
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Response As Integer
If saved = False Then
Response = MsgBox("Do you want to save the changes on this record?", vbYesNo, "Save Changes?")
If Response = vbNo Then
Me.Undo
End If
Me.BtnResetPassword.Enabled = False
End If
End Sub
Private Sub Form_Current()
DoCmd.RefreshRecord
End Sub
Private Sub Form_Dirty(Cancel As Integer)
Me.BtnResetPassword.Enabled = True
End Sub
Private Sub BtnCancel_Click()
Me.Undo
DoCmd.Close
End Sub
The code area i have highlited in red is causing the problem, and for your information i am using access 2010.
Your kind help will be appreciated.
thanks.