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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password protect one field.

Status
Not open for further replies.

Eradic8or

Programmer
Oct 29, 2000
159
GB
Let's see if you can answer this one.
I have a form which has a field bound to a table (no surprise there) but I want to password protect this field so that a user must enter a username and a password before it will let them make a entry. Oh, and the pasword must be enctrypted.

Any suggestions?
 
OK, this is how I would attack it.

First, create a global boolean variable, blnVerified, in a new module.

On your form, call it frmProtect, you need to enter code in the Enter event of the field you want to protect. The code should open a new form, in dialog mode, call it frmPassword. FrmPassword will have textboxes for username and password (set Input Mask to "Password" to hide entry) and a command button. The code behind the command button willl check the username and password and set blnVerified to True or False and close the frmPassword.

The line of code in the Enter event after the line that opened frmPassword, should check the value of blnVerified. If it is False, set the focus to the previous field on the form and show a message box.

I am hoping that when you said encrypted you meant hidden for the password. If you really mean encrypted, I will need more info to help you with that.



Kathryn


 
Thanks for that, but yes I actually meant encrypted.
The people entering the data are all like myself (software engineers) and they would be able to access the VBA modules no problem hence the reason for making the passwords fully encrypted.

 
Do you know that you can password protect the VBA modules??

As far as I know, Access doesn't have any built in encryption capabilities. You would probably need a third-party add-in.

Kathryn


 
I didn't know you could password protect the modules, this would help. Can you enlighten me on how to do this.

Thanks
 
I apologize; I had my VB hat on instead of my Access hat. You can't password protect the modules. You can hide them, though. I just did it, although now I forget how to unhide them. ;-)



Kathryn


 
Read Help Files on making an MDE database, restricts users from viewing code.

PaulF
 
After thinking about this, none of the above options would work as my boss wants the password so encrypted that even I, as the coder do not know what they are.
The field is to state who authorised something for destruction and he does not want anyone (including me) being able to obtain someone else's password for obvious reasons.
 
You are probably NOT going to like this ...

Just set up the Full Ms. Access security module. Assign each user to their group - just like Ms. Access reccomends.

This makes each users name available to the app. There are also routines which can retrieve the User's Group and Name. For those who are 'authourized' to enter data in this field, it can easily be enabled, while for users who are NOT authorized, set the field enabled property to false.

The Ms. Access security module is sufficiently bizzare that it would take a really dedicated effort to 'hack' the passwords. By useing the 'Dirty' property of the form/field, you can also creatre a "Log" of who entered what info into the field, creating an additional "security" log of the changes. Since the field would be "protected" by the encryption of the user lon in password, you would be in compliance w/ the requirement that 'no one' has access to the password encryption. Since the field is not enabled unless the user is a member of the group(s) allowd to access the field, only authourized users could modify it. And any activity for the field could be logged.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Is there anyway someone can post the VB code you used to protect the field within the form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top