Making controls readonly

You can lock and unlock controls on a form by using the .Locked property. When a control is locked, the user can see the data and place the cursor in the control but cannot change the data. (Hence, you say that the information in the control is read-only.) To lock a control from VBA, use the syntax controlName.Locked=True

An unlocked control is a normal control in which the user can see and change the data (called a read/write control). To unlock a control from VBA, use the syntax controlName.Locked=False

Lock a control when you don't want users to change the data, but you still want to give them the ability to select and copy text from the control. If you just disable a control, users cannot select and copy text.

0 0

Post a comment