Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to require a password for an on click event?

Status
Not open for further replies.

3Mark3

Technical User
Nov 30, 2005
48
US
Hello all. I may be going about this the wrong way, but I'd like to password protect a control that will open another form. Is this possible? Or is there a better way to go about this?
 
Do you mean something quite insecure that will merely discourage continuing? If so, something on the lines of:

Code:
If Inputbox ("Enter password: ") <> "PassOK" Then
   Exit Sub
Else
   'Do whatever
End If

Might suit.
 
Or:


Dim X as Variant
X = InputBox("Please enter the password to open this form:", "PASSWORD")
If X = "Your Password" then
DoCmd.OpenForm "frmSomething"
Else
MsgBox("You cannot open this form without a password.")
End if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top