none
HIding controls on a subform from a main form RRS feed

  • Question

  • I don't know why I can never get this kind of stuff right!  I have a Access 2013 form named "5 - IpDetailForm".  (I know, naming convention leaves a lot to be desired!)  It contain a check box named "Approved".  It also contains a subform named "6 - FeatureSubform"  Which contains a control named "DeleteFlag".

    When the "Approved" check box on the form named "5 - IpDetailForm" is set to true, I want to hide the control named "DeleteFlag" on the  form "6 - FeatureSubform".

    This is what I have in the Approved controls AfterUpdate event:

    If Me.Approved = -1 Then 'approval was granted

            Forms![5 - IpDetailForm]![6 - FeatureSubform].Form.deleteFlag.Visible = False

    Endif

    This is what I get

    What have I got wrong?


    • Edited by tkosel Tuesday, January 23, 2018 5:16 PM
    Tuesday, January 23, 2018 5:15 PM

Answers

  • Never mind, I solved my own issue and it has to do with my terrible naming conventions!  The subform is actually named "6-FeatureSubform"

    Sorry about that, guess I better be more careful with naming!!!!!

    • Marked as answer by tkosel Tuesday, January 23, 2018 5:22 PM
    Tuesday, January 23, 2018 5:22 PM

All replies

  • Never mind, I solved my own issue and it has to do with my terrible naming conventions!  The subform is actually named "6-FeatureSubform"

    Sorry about that, guess I better be more careful with naming!!!!!

    • Marked as answer by tkosel Tuesday, January 23, 2018 5:22 PM
    Tuesday, January 23, 2018 5:22 PM
  • If Me.Approved = -1 Then 'approval was granted

            Forms![5 - IpDetailForm]![6 - FeatureSubform].Form.deleteFlag.Visible = False

    Endif

    Hi tkosel,

    What if you try:

    Me![6 - FeatureSubform].Form!deleteFlag.Visible = False
    
    or
    
    Me("6 - FeatureSubform").Form!deleteFlag.Visible = False

    Better check the boolean for True or False, Any value <> 0  gives True.

    Imb.

    Tuesday, January 23, 2018 5:32 PM