By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,247 Members | 1,856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,247 IT Pros & Developers. It's quick & easy.

Security to a command button in a form

P: 1
Hi Guys.........Help Please
I'm trying to add a password to limit access to a command button called"Confidential Information"

Mucho regardo
Sep 13 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
In the On Click event of the button put the following:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim pswd As String
  3.     Set pswd = "anythingyouwant"
  4.     If pswd = InputBox("Enter Password", "Password Required") Then
  5.         'Your Code Here
  6.     Else
  7.         MsgBox "You don't have permission to access this ares", vbOKOnly
  8.         Exit Sub
  9.     End If
  10.  
  11.  
  12.  
Hi Guys.........Help Please
I'm trying to add a password to limit access to a command button called"Confidential Information"

Mucho regardo
Sep 13 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.