I am looking for some command which will disable all controls present in the 'details' section of an MS Access Form. One way is to disable each and every control independently. I am looking for a control-independent way which would disable all the controls present in the details section of MS Access Form.
This feature might be useful, if the form is to be enabled based on some login credentials and the fields for entering credentials is placed in the header section of the form. So, as soon as user does login, all the controls in that form are enabled. Uplon logout, they shall be disabled.
I tried searching for it but it seems the same is not supported. Or no one had such a requirement before.
Please help me if anyone knows.
You can disable all of the controls in the detail section directly without having to bother with tags:
Similarly, you can get at the controls in the header and footer using
FormHeader.Controls
andFormFooter.Controls
.I usually prefer to use
ctrl.Locked = True
instead ofctrl.Enabled = False
since users can still copy text from locked controls and use text filters on them, but that's up to you.A form has various properties that match this requirement: Allow Edits, Allow Additions and Allow Deletions. Allow Edits works for unbound controls, it even works on unbound forms.
If you have a requirement to disable certain controls, you can set the tab property for these controls to a string and then iterate through the form's control collection to disable those controls.