• Hide Field on Subform

    Author
    Topic
    #353417

    I am using a Tab Control with subforms. I would like to hide a field on the subform when the file opens. This should be really simple but I am having trouble…..help!!

    Viewing 0 reply threads
    Author
    Replies
    • #516907

      You can set the visible property of the control to NO or in code Me.mycontrol.Visible = False

      • #516912

        The field I am trying to hide is located on a tab control in a subform. This subform is also used on another form so I can’t set the control visible property to no.

        I have tried using “Me.sfmJobs![cboProject].Visible = False” in the onOpen event of the form, however, this doesn’t work. I receive a runtime error 2165 stating you can not hide a control that has the focus.

        • #516918

          How about setting the Height and Width Properties to “0” Zero to hide it?

          • #516922

            This subform is also used/shared as a subform for other forms. Changing any of the control properties would also be reflected in all instances the subform it is used in. I need to be able to hide the control of a subform when the parent form is opened.

            • #516929

              Wouldn’t this work:[indent]


              Me.sfmJobs![cboProject].Height =0
              Me.sfmJobs![cboProject].Width =0 in the onOpen event of the form.


              [/indent]

            • #516935

              I figured it out!

              If I set the tab stop property of the control to “no” and then use the onOpen event of the form with ‘Me.sfmJobs![cboProject].visible = False’ it works fine!!

            • #516937

              Right you are! That’s great.

        • #517041

          Before setting the visible property to false set the focus to another control.

    Viewing 0 reply threads
    Reply To: Hide Field on Subform

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

    Your information: