A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Password Protect one Field



 
 
Thread Tools Display Modes
  #1  
Old February 3rd, 2009, 03:25 PM posted to microsoft.public.access.gettingstarted
junkgrrl
external usenet poster
 
Posts: 3
Default Password Protect one Field

I would like to password protect our NAME field in our database so it's not
visible to everyone who has access to it with the exception of a few people.
There are 21 fields total on our form. We're using Access 2003. Those who are
allowed to view this field could use the same password.

I've read that this is possible but I can't seem to have any luck. I've
tried putting the codes in, adding buttons. and it's not working.

What am I doing wrong? What should I do first? How should I set this up
without messing up our database with 3500 people?

Thanks
  #2  
Old February 3rd, 2009, 04:29 PM posted to microsoft.public.access.gettingstarted
Keith Wilby
external usenet poster
 
Posts: 812
Default Password Protect one Field

"junkgrrl" wrote in message
...
I would like to password protect our NAME field in our database so it's not
visible to everyone who has access to it with the exception of a few
people.
There are 21 fields total on our form. We're using Access 2003. Those who
are
allowed to view this field could use the same password.

I've read that this is possible but I can't seem to have any luck. I've
tried putting the codes in, adding buttons. and it's not working.

What am I doing wrong? What should I do first? How should I set this up
without messing up our database with 3500 people?

Thanks


You'd have to set up user level security and user the CurrentUser function
to determine who's logged to and set the surname text box's visible property
accordingly. Not an easy task if you've never done it before.

Keith.
www.keithwilby.co.uk

  #3  
Old February 4th, 2009, 11:27 PM posted to microsoft.public.access.gettingstarted
Damon Heron[_2_]
external usenet poster
 
Posts: 237
Default Password Protect one Field

A real simple solution is to create a little popup form for password entry,
with a textbox and label. The label caption reads "Enter Password". The
textbox input mask is set to Password.

Now, on your main form, set the name field visible property to false. Add a
label that is captioned "Name", and add a click event to the label:
(my password form is called frmPW)

if me.text1.visible= false then 'text1 is the name of my
textbox -substitute yours
DoCmd.openform "frmPW", acNormal, , , , acDialog
end if
This opens the password form and allows the user to enter the correct
password.

In the textbox before update event of the password form, put this code:

Private Sub txtInput_BeforeUpdate(Cancel As Integer)
If Me.txtInput = "XYZ" Then
Forms!form2.Form!Text1.Visible = True
DoCmd.Close acForm, "frmPW"
Else
Me.lblInput.Caption = "Try Again"
End If
End Sub

Note that I called this a simple solution. The password in my example is
hardcoded, for instance. Also, the form allows unlimited tries. You could
add a counter to limit the tries if you wanted.

Damon


"junkgrrl" wrote in message
...
I would like to password protect our NAME field in our database so it's not
visible to everyone who has access to it with the exception of a few
people.
There are 21 fields total on our form. We're using Access 2003. Those who
are
allowed to view this field could use the same password.

I've read that this is possible but I can't seem to have any luck. I've
tried putting the codes in, adding buttons. and it's not working.

What am I doing wrong? What should I do first? How should I set this up
without messing up our database with 3500 people?

Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.