Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moving existing controls into a tab control (2007)

    I used the code from HansV that he shared some time ago (<!post=Linking to pictures,296,892>Linking to pictures<!/post>) 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.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Moving existing controls into a tab control (2007)

    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.
    Attached Images Attached Images
    Regards
    John



  3. #3
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving existing controls into a tab control (2007)

    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.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Moving existing controls into a tab control (2007)

    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.
    Attached Images Attached Images
    Regards
    John



Posting Permissions

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