Full Version: Password Dialog Box (a Form)
UtterAccess Forums > MicrosoftŪ Access > Access Forms
nschoonover
I created a simple dialog box popup form. It check the password and then opens a form if it is correct.
My only problem is that i can't get it to close after opening the new form.
CODE

Public Sub GetPW()
If PW = Forms!frmhiddenform.Password.value Then
DoCmd.OpenForm "frmAdminSettings"
DoCmd.Close acForm, "frmEnterPassword"
Else
MsgBox "Wrong Password! Try Again!", vbCritical, "Wrong Password"
Me.PW.SetFocus
End If
End Sub

This gives the error 2585 "This action cannot be carried out while processing a form or event." The error is in reference to the docmd.close part.
Can someone help me out here. i just want the dialog form to close after the PW is correct.
And why doesn't access include a PWInputBox, just like the InputBox??? or just an option for masking characters in an InputBox. This is a ridiculous workaround for something that should be simple.
Thanks!
Nate
niesz
If the form was opened in Dialogue mode, I don't think you'll be able to close it until all other forms that were spawned after it's opening are closed.
If you need to mask characters there is a "Password" Input Mask that can be applied to a txtbox on a form. You may have to build a custom form to capture the password.
CyberCow
Just close the EnterPassword form before you open the AdminSettings form.
Hope this helps
nschoonover
thanks "moo" tongue.gif It seems to be working just fine now! sad.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.