G
Guest
Hi,
I had the following code (found from this discussion group) to allow only
password holders to access the form. But after the password-protected form is
opened, the previous form still remains open. Could someone please show me
the code that could be atttached to the following code to close the previous
form IF correct password is entered? Any help is much appreciated.
Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"
If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
End If
End Sub
I had the following code (found from this discussion group) to allow only
password holders to access the form. But after the password-protected form is
opened, the previous form still remains open. Could someone please show me
the code that could be atttached to the following code to close the previous
form IF correct password is entered? Any help is much appreciated.
Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"
If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
End If
End Sub