Hello all,
I do not understand much of VBA. But I will give my best shot to understand it.
Here is my little problem::
I have login screen. Works fine.
Now I have created a 'change password' form.
Form name: Wachtwoord wijzigen
Old password = txtOld
New password = newpassword1
Verirfy= newpassword2
It has to get all the data from this table:
Tablename: Medewerkers
Field1: Gebruiker
Field2: Wachtwoord
Here is my code:
I get a message after I press the 'Change password" buttoN:
RunTime error 2450
Start-Up cannot find the reference from "Gebruiker".
I am probally doing something wrong?
I do not understand much of VBA. But I will give my best shot to understand it.
Here is my little problem::
I have login screen. Works fine.
Now I have created a 'change password' form.
Form name: Wachtwoord wijzigen
Old password = txtOld
New password = newpassword1
Verirfy= newpassword2
It has to get all the data from this table:
Tablename: Medewerkers
Field1: Gebruiker
Field2: Wachtwoord
Here is my code:
Code:
Dim sMsg As String Dim iResponse As Integer If Len(Nz(Me.txtOld, "")) = 0 Then MsgBox "Please input the current password.", , "Current Password" Me.txtOld.SetFocus ElseIf Len(Nz(Me.newpassword1, "")) = 0 Then MsgBox "Please enter the new password.", , "New Password" Me.newpassword1.SetFocus ElseIf Len(Nz(Me.newpassword1, "")) = 0 Then MsgBox "Please reenter the new password.", , "New Password Verification" Me.newpassword2.SetFocus Else sMsg = "Are you sure you want to change the password?" iResponse = MsgBox(sMsg, vbYesNo + vbQuestion + vbDefaultButton1, "Change Password") Select Case iResponse Case vbYes iResponse = acDataErrContinue If Me.txtOld = Forms!Gebruiker!Wachtwoord Then If Me.newpassword1 = Me.newpassword2 Then Forms!Medewerkers!Wachtwoord = Me.newpassword1 MsgBox "The password has been changed to " & Chr(34) & Me.newpassword1 & Chr(34) & ".", , "Password Changed" DoCmd.Close acForm, "frmChangePassword" DoCmd.Close Else MsgBox "The new password has been entered incorrectly.", , "New Password" Me.newpassword1 = Null Me.newpassword2 = Null Me.newpassword1.SetFocus End If Else MsgBox "The current password is not correct.", , "Incorrect Password" Me.txtOld = Null Me.txtOld.SetFocus End If Case vbNo iResponse = acDataErrContinue End Select End If End Sub
RunTime error 2450
Start-Up cannot find the reference from "Gebruiker".
I am probally doing something wrong?