Are you asking how he maked the password protected exit.
Its simple below wud be the code
Private Sub Form_Unload(Cancel As Integer)
Dim inputanswer As String
inputanswer = InputBox("What is the password to exit")
If inputanswer = "password" Then
Cancel = "0"
Else
Cancel = "1"
End If
This means that when you try to Unload the form, it asks for a password, If the password is "password" then it does nothing and naturally ends the sub. If the password is anything "ELSE" then Cancel = 1 which cancels the request to end the sub.




Reply With Quote