mb said:
Is there a way to write a code that will disable all the fields on the
current record of a form until an "Edit This Record" command button is
clicked?
You probably want to use Lock instead of Disable. The
answer is the same in either case.
You can not disable "fields", you can only disable controls.
However you can not disable every kind of control (e.g.
label). You also do not want to disable every control that
can be disabled (e.g. the "Edit This Record" command
button).
So, the question is more about how to identify the controls
that should be disabled. A common technique is to set these
controls' Tag property to something like Block. Then the
code could look like:
Private Function DoEnable(OnOff As Boolean)
Dim ctl As Control
For Each ctl Me.Controls
If ctl.Tag = "Block" Then ctl.Enabled = OnOff
Next ctl
End Function
And the form's Current event can disable the controls with:
DoEnable False
and your button can enable the controls using:
DoEnable True