ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Password protection for an individual form (https://www.excelbanter.com/excel-programming/348412-password-protection-individual-form.html)

Mort_Komabt[_2_]

Password protection for an individual form
 
Hi All,

I am creating a menu system within a form, one of the options is
Administration. Once selected this loads a subform with the admin options.

Does anyone now if it is possiable to put password protection on the admin
subform only thus keeping a general user away from the admin options?

Regards and Thanks

Mick

Jake Marx[_3_]

Password protection for an individual form
 
Hi Mick,

Mort_Komabt wrote:
I am creating a menu system within a form, one of the options is
Administration. Once selected this loads a subform with the admin
options.

Does anyone now if it is possiable to put password protection on the
admin subform only thus keeping a general user away from the admin
options?


If you want to use Windows security (probably the best bet if you can), you
could simply check the username and determine what to do based on that:

MsgBox Environ$("username")

If you want to do your own password prompt, you'll have to create another
form that looks like a logon box (with PasswordChar property set to "*" for
the TextBox the user will type his/her password into). If you do this,
you'll want to lock your VBA project for viewing so that it's harder to get
to the password in your code.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]



Mort_Komabt[_2_]

Password protection for an individual form
 
Thanks for that. Works great

"Jake Marx" wrote:

Hi Mick,

Mort_Komabt wrote:
I am creating a menu system within a form, one of the options is
Administration. Once selected this loads a subform with the admin
options.

Does anyone now if it is possiable to put password protection on the
admin subform only thus keeping a general user away from the admin
options?


If you want to use Windows security (probably the best bet if you can), you
could simply check the username and determine what to do based on that:

MsgBox Environ$("username")

If you want to do your own password prompt, you'll have to create another
form that looks like a logon box (with PasswordChar property set to "*" for
the TextBox the user will type his/her password into). If you do this,
you'll want to lock your VBA project for viewing so that it's harder to get
to the password in your code.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]





All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com