Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Tabbing (Access 2003)

    Back in Post 361004 ( no such thing as an old post ) MarkD had this neat little routine which would allow you to click on a button and move from TabPage to TabPage. Never did figure out how to use it without a clickable button, but my version worked. It looked like this:

    Private Sub GoToNextTab_Click()
    With Me.TabCtl1
    If .Value = .Pages.Count - 1 Then
    .Value = 0
    Else
    .Value = .Value + 1
    End If
    End With
    End Sub

    Now, what I
    Cheers,
    Andy

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Do you have Option Explicit? Have you declared TabCtl1?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Hi Jeremy,

    Haven't "talked" in a while. With respect to Option Explicit, it's just like my American Express Card .. I never open without one. Now, here comes the dirty laundry. I have managed to get this far in my dubious coding career without having "Declared" anything. Go Figure! So, if you could be kind enough to show me the light, I'd much appreciate it,
    Cheers,
    Andy

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Tab Tabbing (Access 2003)

    If you have Option Explicit on, then you have had to declare any variables you use. The way you declare them in VBA is to write something like

    Dim strMyVar As String

    Dim stands for Dimension, which goes way, way back to earlier programming languages.
    Charlotte

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Tab Tabbing (Access 2003)

    It looks to me like TabCtl1 is a control. You don't declare controls, only variables. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Charlotte

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Tabbing (Access 2003)

    When you say Public Function, I assume that you put it in a standard module. You can use Me only in the module belonging to a form or report (or in a class module, but we won't go into that here). Me refers to the form or report running the code. In a standard module, Me has no meaning. Try replacing <code>Me.TabCtl1</code> with <code>CodeContextObject!TabCtl1</code>

  7. #7
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Charlotte:

    Thank You - Part 1
    Cheers,
    Andy

  8. #8
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Charlotte:

    Thank You - Part 2.

    You're correct, it is the name of the first tab on the Tab Form
    Cheers,
    Andy

  9. #9
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    TabCtl1 is the Name assigned to the 1st tab in the form
    Cheers,
    Andy

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Tabbing (Access 2003)

    I had expected that you would call the function from the form. By putting it in a macro, the code is not called from a form, so there is no CodeContextObject. Try replacing CodeContextObject with Screen.ActiveForm

    (Wouldn't your users be happier with punch cards instead of Windows?)

  11. #11
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> Maybe pencil and paper, no machines of any kind involved. Perhaps they don't have fingers and can't click?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  12. #12
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Hans,

    First, and as always, your solution worked perfectly.

    Secondly, I've tried to introduce them to the joys of paper tape.

    Anyway, do not poke fun at punched cards. If I had a nickel for every card I ever sorted, I'd be retired somewhere in a far warmer climate.
    Cheers,
    Andy

  13. #13
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Jeremy, Jeremy, Jeremy,

    I think that you and Hans and I should sit down and come up with a comedy skit about the hilarity of dealing with a) Clients and [img]/forums/images/smilies/cool.gif[/img] the joys of Access Programming.

    Saturday Night Live would have to start watching their backs. There'd be sitting room only!
    Cheers,
    Andy

  14. #14
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    LOL, it's not that funny, just so darn annoying at times. So many people are adamant in their ways, but will spend half their budget on new technology, just to run their old programs. <img src=/S/puke.gif border=0 alt=puke width=60 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  15. #15
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Tabbing (Access 2003)

    Jeremy,

    In all seriousness, there are occasions where
    Cheers,
    Andy

Page 1 of 2 12 LastLast

Posting Permissions

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