Display Message?

N

Neil Cash

I have a form with text fields on it and a command button. The command
button runs a macro, which runs a code:

Function ChangePassword() As Integer

Dim ws As Workspace
Dim usr As user
Dim OPwd As String
Dim NPwd As String
Dim MSG As Variant
Dim user As String

user = CurrentUser()
OPwd = Forms("Password").[OldPassword]
NPwd = Forms("Password").[NewPassword]

Set ws = DBEngine.Workspaces(0)
Set usr = ws.Users(user)

usr.NewPassword OPwd, NPwd
MSG = MsgBox("Password Changed", vbOK)
DoCmd.Close

End Function

The question is, what and where can I put something into the code that tests
whether or not the old password supplied is correct. Currently, if you
supply an incorrect password the debugger pops up and the macro comes to a
halt. Thanks in advance.

Neil Cash
 

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