• Moving existing controls into a tab control (2007)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Moving existing controls into a tab control (2007)

    Author
    Topic
    #455868

    I used the code from HansV that he shared some time ago (Linking to pictures) and it works fine in my form but when I move the controls into a tab – by cutting and pasting, they no longer work. I am probably incorrectly moving these controls but cut/paste is all that seems to work for me. I am unable to simply drag them into the tab page.

    Also, I noticed that when I moved an option group into the tab page, the associated code doesn’t work that previously worked. This was an On Current event for the form.

    If Me.Frame68 = 1 Then
    Me.Frame68.BackColor = RGB(237, 28, 36)
    Me.Label111.Visible = True
    Else
    Me.Frame68.BackColor = RGB(214, 223, 236)
    Me.Label111.Visible = False
    End If

    What’s the solution? Should I change Me.Frame68 to me.Page123.Frame68? Page123 is the tab page.

    Viewing 0 reply threads
    Author
    Replies
    • #1136704

      When you cut and paste controls, they lose their connection with their code,but the code still exists.
      But you are doing it the right way. Dragging does not work.

      For each control, you need to go the On Click event, and reselect [Event Procedure] again.

      I had to do this myself this morning when I moved a whole pile of buttons to a different page of a tab control.

      The code in the oncurrent event should still work. Controls on a tab page can be referenced without referring first to the tab control.

      • #1136721

        That was the problem. Thanks.

        I am having a lot of trouble cutting and pasting into the tab. I keep clicking and pasting until all of a sudden it works. Is there a secret to this? When i try to paste in the tab, it continues to paste back in the original location.

        • #1136722

          Make sure you click the right page tab before you paste.

          In Access 2007, you will see a orange/yellow rectangle within the page when you click the tab.

    Viewing 0 reply threads
    Reply To: Moving existing controls into a tab control (2007)

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

    Your information: