locked
Disable a subform without making making it look disabled? RRS feed

  • Question

  • I feel like I'm overlooking something very simple.  I have a subform on a form that I would like to completely disable in the sense that I would like it to behave as though I had set its Enabled property to False but I would like to not change its appearance.  I would like it to be completely unresponsive to mouse clicks, tab advance, etc. but appear as though it were enabled.  Controls on the subform should not be able to receive focus.  Is there a simple way to do this that doesn't involve convoluted code?  Thanks.

    -Bruce

    Thursday, March 10, 2016 5:19 PM

Answers

  • I feel like I'm overlooking something very simple.  I have a subform on a form that I would like to completely disable in the sense that I would like it to behave as though I had set its Enabled property to False but I would like to not change its appearance.  I would like it to be completely unresponsive to mouse clicks, tab advance, etc. but appear as though it were enabled.  Controls on the subform should not be able to receive focus.  Is there a simple way to do this that doesn't involve convoluted code?  Thanks.

    Maybe it's my screen or my eyes -- or my Access version (2010) -- but I don't see any difference in the appearance of a subform when its Enabled property is set to False.  That said, have you tried setting Enabled = False and Locked = True?  With normal controls, that makes the control appear enabled even though it's actually disabled.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by Bruce Hulsey Thursday, March 10, 2016 5:32 PM
    Thursday, March 10, 2016 5:28 PM

All replies

  • I feel like I'm overlooking something very simple.  I have a subform on a form that I would like to completely disable in the sense that I would like it to behave as though I had set its Enabled property to False but I would like to not change its appearance.  I would like it to be completely unresponsive to mouse clicks, tab advance, etc. but appear as though it were enabled.  Controls on the subform should not be able to receive focus.  Is there a simple way to do this that doesn't involve convoluted code?  Thanks.

    Maybe it's my screen or my eyes -- or my Access version (2010) -- but I don't see any difference in the appearance of a subform when its Enabled property is set to False.  That said, have you tried setting Enabled = False and Locked = True?  With normal controls, that makes the control appear enabled even though it's actually disabled.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by Bruce Hulsey Thursday, March 10, 2016 5:32 PM
    Thursday, March 10, 2016 5:28 PM
  • Thanks Dirk, you are correct.  I didn't actually try this in form view but in design view it turned my subform control gray.  I just assumed that it was going to look different (like a textbox or listbox would) with the enabled property set to false.  And thanks for the tip regarding the combination of locked and enabled properties.  That's a trick I was not aware of.

    -Bruce

    Thursday, March 10, 2016 5:32 PM