We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Sub ProtectFields(ColumnNum As String) Dim Ctl As Control For Each Ctl In Forms!Sales_Contract_Review.Controls ' make sure i am looking at the correct textboxes If Ctl.Parent.Name = "Sales_Contract_Review" And IsNumeric(Mid(Ctl.Name, 1, 2)) And Mid(Ctl.Name, 3, 1) = "-" And IsNumeric(Mid(Ctl.Name, 4, 2)) Then ' protect all fields except ones with the passed variable in column 4-5 If Mid(Ctl.Name, 4, 2) <> ColumnNum Then ' msgbox "lock:" & Ctl.Name Ctl.Enabled = False Ctl.Locked = True Else ' msgbox "unlock: " & Ctl.Name If Ctl.Value <> "M" Then Ctl.Enabled = True Ctl.Locked = False End If End If End If Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.