• Conditional Formatting and Locked/Disabled Fields (Access 2002 SP-2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Conditional Formatting and Locked/Disabled Fields (Access 2002 SP-2)

    Author
    Topic
    #406552

    I have a continuous form with a field that is shown locked (Locked = Yes) and disabled (Enable = No) so that it can’t get the focus nor be changed. I want to use Conditional Formatting to change the color when the displayed number is out of range. It appears that when the condition is evaluated, the locked property is set to No, whether or not the condition is satisfied — this causes the field becomes editable and it can get the focus, which I don’t want. Is there any way to keep it locked (e.g. via VBA)?

    Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #844030

      Enabled is one of the properties you can set in Conditional formatting. The default is Yes, so unless you explicitly turn off “Enabled” in each section of the Conditional Formatting dialog, the control will be enabled despite the setting in design view. Conditional formatting should have no influence on the Locked property, however. But if you make sure that Enabled is set to No, it won’t matter.

      • #844192

        Hans,

        Thanks for the reply. I think I tried that — when I turned enabled off in the Conditional Formatting dialog, the field then appeared “greyed out” (as it would if enabled was off and locked was off) if the condition was satisfied. Being disabled, it couldn’t get the focus and couldn’t get edited (which is good), but it has that disabled look that I don’t want (I want the disabled and locked look — normal appearing but not editable and unable to get the focus).

      • #844193

        Hans,

        Thanks for the reply. I think I tried that — when I turned enabled off in the Conditional Formatting dialog, the field then appeared “greyed out” (as it would if enabled was off and locked was off) if the condition was satisfied. Being disabled, it couldn’t get the focus and couldn’t get edited (which is good), but it has that disabled look that I don’t want (I want the disabled and locked look — normal appearing but not editable and unable to get the focus).

        • #844204

          Are you sure that the controls have Locked = Yes in design view, and that there is no code that sets Locked to False? I am using Access 2002 SP-2 too, and although setting Enabled to “off” in the Conditional Formatting dialog makes the sample control look grayed out, it looks fine in the form itself.

        • #844205

          Are you sure that the controls have Locked = Yes in design view, and that there is no code that sets Locked to False? I am using Access 2002 SP-2 too, and although setting Enabled to “off” in the Conditional Formatting dialog makes the sample control look grayed out, it looks fine in the form itself.

    • #844031

      Enabled is one of the properties you can set in Conditional formatting. The default is Yes, so unless you explicitly turn off “Enabled” in each section of the Conditional Formatting dialog, the control will be enabled despite the setting in design view. Conditional formatting should have no influence on the Locked property, however. But if you make sure that Enabled is set to No, it won’t matter.

    Viewing 1 reply thread
    Reply To: Conditional Formatting and Locked/Disabled Fields (Access 2002 SP-2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: