Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    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.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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).

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    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.
    Attached Images Attached Images
    • File Type: png x.png (1.3 KB, 1 views)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •