"Not Enabled" vs "Locked"

  • Thread starter Thread starter el zorro
  • Start date Start date
E

el zorro

What's the difference bnetween a form field
being "Locked" and being "Not Enabled," as indicated by
the property settings for the field (i.e., Enabled = No,
or Locked = Yes)?
 
From the Help file:

· The Enabled property specifies whether a control can have the focus in
Form view.
· The Locked property specifies whether you can edit data in a control in
Form view.

Use the Enabled property to enable and disable controls. For example, in
Form view you can disable a command button until you have changed data in a
text box control. You can then use the control's AfterUpdate event to call
an event procedure or macro to enable the command button.

Use the Locked property to protect data in a field by making it read-only.
For example, you might want a control to only display information without
allowing editing, or you might want to lock a control until a specific
condition is met.

You can combine the Enabled and Locked property settings to achieve the
following effects.

Enabled = Yes, Locked = Yes: The control can have the focus. Data is
displayed normally and can be copied but not edited.

Enabled = Yes, Locked = No: The control can have the focus. Data is
displayed normally and can be copied and edited.

Enabled = No, Locked = Yes: The control can't have the focus. Data is
displayed normally but can't be copied or edited.

Enabled = No, Locked = No: The control can't have the focus. Control and
data are disabled (dimmed).

The TabStop property can be combined with the Enabled property to prevent
the use of the TAB key to select a command button, while still allowing use
of the button by clicking it. Setting the TabStop property to No means that
the command button won't be in the tab order. However, if the Enabled
property is set to Yes, then you can still click the command button.
 
el zorro said:
What's the difference bnetween a form field
being "Locked" and being "Not Enabled," as indicated by
the property settings for the field (i.e., Enabled = No,
or Locked = Yes)?

Enabled determines whether the control can get focus whereas Locked
determines whether the control can be edited. While it is true that a
control that cannot receive focus also cannot be edited there might be
times when you don't mind the user entering the control (perhaps so they
can copy the value to the clipboard), but you just don't want them changing
the value. That is when you would use Locked = True

Also; providing Locked = False, setting Enabled to False will change the
appearance of the control to grayed out as a visual clue to the user that
the control cannot be accessed.
 
Back
Top