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 derfloh 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.

chipearly

Technical User
Joined
Jun 19, 2003
Messages
12
Location
US
I have a need to password protect one field in a form. I am using this as a manger's approval to start a project. So if the mangager has entered his name in the textbox, then the project can be started. I had found this code:

If InputBox("Please Enter Laboratory Manager Password") = "goober" Then 'Password correct, so unlock the field
txtfield.Locked = False
Else
'Password incorrect, so lock the field
txtfield.Locked = True
End If

It will let me enter the password but I get an error on the"
txtfield.locked = False

Can anyone help me out?
 
are you sure (make sure) the name of your field matches the name you have specified in your code?

for example, could the name of the field on the form be textfield instead of txtfield?

if this isn't it, try inserting "me." in front of your field,
like this

me.txtfield.locked = false

as soon as you type me. Access will show you what objects you have available to choose from.

just some thoughts....
 
I do apologize, stupid mistake on my part, I did have a typo in it, sorry for the inconvience, but thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top