G
Guest
Similar to a previous post but with a twist (no lemon)...
I want (nearly) all the fields on my form NOT to allow edits, if one of the
fields value is true.
Is there a better way to protect the data in my fields based on the users
selection of Protect data Y/N combo box? The trouble is the Protect Data
field is on the form! So I can't change it back once it has been selected.
My code is:
' ======== Protect Data code starts here =========
With Me
.AllowEdits = Not Nz((!ProtectData = "Yes"), False)
.AllowDeletions = Not Nz((!ProtectData = "Yes"), False)
End With
' ========= Protect Data code ends here ====================
The trouble with the code is that it protects the entire form, including the
field with the value of Yes/No for protecting the data. Such that, once you
select Yes, you can't change it back to No.
I thought wow that was easy ….... HA !
Previously I have had to include each individual field (enabled = False)
code for the on current event of the form, and also the on_lost_focus event
of the field in question.
Is there a better way to protect just about all the data in my fields based
on the users selection of Protect data Y/N combo box? Also, is there a
better option rather than enabled = False?
Many thanks for any advice.
I want (nearly) all the fields on my form NOT to allow edits, if one of the
fields value is true.
Is there a better way to protect the data in my fields based on the users
selection of Protect data Y/N combo box? The trouble is the Protect Data
field is on the form! So I can't change it back once it has been selected.
My code is:
' ======== Protect Data code starts here =========
With Me
.AllowEdits = Not Nz((!ProtectData = "Yes"), False)
.AllowDeletions = Not Nz((!ProtectData = "Yes"), False)
End With
' ========= Protect Data code ends here ====================
The trouble with the code is that it protects the entire form, including the
field with the value of Yes/No for protecting the data. Such that, once you
select Yes, you can't change it back to No.
I thought wow that was easy ….... HA !
Previously I have had to include each individual field (enabled = False)
code for the on current event of the form, and also the on_lost_focus event
of the field in question.
Is there a better way to protect just about all the data in my fields based
on the users selection of Protect data Y/N combo box? Also, is there a
better option rather than enabled = False?
Many thanks for any advice.