Error when running form

I

Immanuel_Black

Hello,

I am making a password change form for my applications. I'm using the access
built in workspace users and groups for my user functionality. So far
everything has been working perfectly up until now. It probably a small error
but I cannot seem to find the problem.

Here is the code I am using:



Private Sub btnSubmit_Click()
On Error GoTo errPasswordChangeError

Dim strUserName As String
Dim strOldPasswordConfirm As String
Dim strOldPassword As String
Dim strNewPassword As String
Dim lngRed As Long

lngRed = RGB(255, 0, 0)

If (txtConfirmPassword <> txtNewPassword) Then
GoTo errPasswordsDoNotMatch
End If

If (txtNewPassword = "") Then
GoTo errNewPasswordEmpty
End If

If (txtConfirmPassword = "") Then
GoTo errConfirmPasswordEmpty
End If

strUserName = txtUserName
strOldPassword = txtOldPassword
strNewPassword = txtNewPassword

Call modChangeUserPassword.apChangeUserPassword(strUserName,
strOldPassword, strNewPassword)

Exit Sub

errPasswordsDoNotMatch:
txtConfirmPassword.ForeColor = lngRed
MsgBox "The passwords do not match. Please make sure the passwords match"
txtConfirmPassword.SetFocus
Exit Sub

errNewPasswordEmpty:
MsgBox "Please enter a value into the New Password Field"
txtNewPassword.SetFocus
Exit Sub

errConfirmPasswordEmpty
MsgBox "Please enter a value into the Confim Password Field"
txtConfimPassword.SetFocus
Exit Sub

errPasswordChangeError:
txtOldPassword.ForeColor = lngRed
MsgBox "Password change was unsuccessful. The password you entered may
not match your current password. Please make sure the Old Password field is
correct"
txtOldPassword.SetFocus
Exit Sub
End Sub



it says the error is at 'errConfirmPasswordEmpty:'

Any insight into the problem would help immensely

Thank you in advance

James (aka Immanuel_Black)
 
I

Immanuel_Black

Thanks for noticing that. Sometimes its the smallest things that cause the
biggest problems. haha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top