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

Lock a text box.

Status
Not open for further replies.

JojoKa

Technical User
Mar 28, 2006
18
US
Hi,
I have a form (FMain) with a page /tab that contains 4 text boxes. When a user logs in to access the form using this password (Hedis) then txt1 and txt 2 must be locked and the other 2 are not.

Let's say text boxes names are:
Txt1, Txt2, Txt3, Txt4.

this is what I did but it doesn't seem to work:

If txtPassword = "Hedis" then
Me.FMain!Txt1.Locked = true
Me.FMain!Txt2.Locked = true
Me.FMain!Txt3.Locked = False
Me.FMain!Txt4.Locked = False

Elseif txtPassword = "Physician" then
Me.FMain!Txt1.Locked = true
Me.FMain!Txt2.Locked = true
Me.FMain!Txt3.Locked = true
Me.FMain!Txt4.Locked = true

End if
End sub

Thanks in advance

Joseph
 
Have you tried this ?
If txtPassword = "Hedis" Then
Me!Txt1.Locked = True
Me!Txt2.Locked = True
Me!Txt3.Locked = False
Me!Txt4.Locked = False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
No, I haven't. I'll let you know if it works. Thanks.
Joseph
 
the following worked as well:

If txtPassword = "Hedis" Then
Forms!Master!Txt1.Locked = True
etc...

thanks

Joseph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top