HI
I am trying to loop through some (not all) boxes on a user form to lock/unlock them when a particular command button is clicked. The controls in questions all have names that start with "POinv" and then a number. I have the following code but it's not working as it doesn't seem to like controls.locked. How else can I do this?
Private Sub CommandButton2_Click()
'validate purchase order info on invoice form
Dim x As Integer
'unlock text boxes
For x = 1 To 11
Me.Controls("POinv" & x).Locked = False
Next
End Sub
Thanks in advance
I am trying to loop through some (not all) boxes on a user form to lock/unlock them when a particular command button is clicked. The controls in questions all have names that start with "POinv" and then a number. I have the following code but it's not working as it doesn't seem to like controls.locked. How else can I do this?
Private Sub CommandButton2_Click()
'validate purchase order info on invoice form
Dim x As Integer
'unlock text boxes
For x = 1 To 11
Me.Controls("POinv" & x).Locked = False
Next
End Sub
Thanks in advance