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

Locking all controls on a form

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
I need to lock all the controls on a invoice form. I want to use a command button to do this. How can I without having to writing the code for each record??<br><br>Me!&quot;FieldName&quot;.Locked=True<br>Me!&quot;FieldName1&quot;.Locked=True<br>Me!&quot;FieldName2&quot;.Locked=True<br>ect.<br><br>Thanks<br>
 
Try something like this:<br><br>Dim ctrl as Control<br><br>For each ctrl in Controls<br>If Typeof ctrl Is Not Label Then<br>&nbsp;&nbsp;ctrl.locked=true<br>End If<br>Next<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top