JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: Password Archived to Disk
If you want the password to be entered in the "MsgBox" then you have to use an inputbox (or just load another form for just the password). Messageboxes don't allow text to be inserted.
but the following will give a general idea:
Private fAllowExit as Boolean
Private Sub GetPassword()
Dim PWD as String
Dim sRet as String
fAllowExit=False
PWD = "password"
' For inputbox
sRet = InputBox("Password", "Password")
If sRet = PWD then fAllowExit=True
' For Just putting in a form
if FormName.txtPassword.Text=PWD Then fAllowExit=True
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = Not fallowexit
End Sub
|