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!

Change from Read-Only to Update and Back

Status
Not open for further replies.

Debbilynn

Technical User
Dec 8, 2008
8
US
I have a command button on a form which changes most fields from Locked to Unlocked based on the Tag.

For Each ctl In Forms![frmChangeRequests].Controls
If ctl.Tag = "LOCK" Then
ctl.Locked = False
End If
Next ctl

The code works perfectly well but I want to add to this so the same button can switch the user back to Read Only. I'm sure there is an If statement involved but I cannot for the life of me figure out how to do this.

Can anyone help me so the same button can change from RO to Update and back?

Thanks!
 

Is this what you ended up with?
Code:
For Each ctl In Forms![frmChangeRequests].Controls
    ctl.Locked = Not ctl.Locked
Next ctl


Randy
 
Yes, thank you. Seems every time I post a question here, I end up figuring out the answer. Weird.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top