You can set up tab controls so there are no tabs showing, so what you are
after is not entirely unreasonable. Just thinking off the top of my head
and incorporating Larry Hahm's suggestion, you could set up two small
command buttons with a small text box between them - much like the Access
navigation buttons - with left and right arrows.
Then you could display the current page number in the text box and allow the
user to move forward and back using the command buttons or jump to a
specific page using the text box.
I don't follow your statement. How will the button code know which page
you
want to go to? and when to go to that page and when to flip?
If you define what you want, I can help.
As to the problem with your code.
First 0 is the first page, not 1, so I don't know what you really intend
here
Private Sub DataLabel_Click()
If Me.Tabs = 1 Then >> you are on the second page
If Me.Tabs < Me.Tabs.Pages.Count - 1 Then
Me.Tabs = Me.Tabs + 1 >> Never executes you have > 2 pages
Else
Me.Tabs = 0 >> Always executes and returns to first page
End If
Else
Me.Tabs = 1 >> returns you to the second page
End If
End Sub
One more thing - When This button is pushed, I'd like it to go to a
specific page in the tab control and then after that "flip" through
the pages. I've tried the following and it is not working - it just
tabs between pages 1 and 2.
Private Sub DataLabel_Click()
If Me.Tabs = 1 Then
If Me.Tabs < Me.Tabs.Pages.Count - 1 Then
Me.Tabs = Me.Tabs + 1
Else: Me.Tabs = 0
End If
Else: Me.Tabs = 1
End If
End Sub
Any ideas?
thanks in advance -magmike- Hide quoted text -
- Show quoted text -
In truth, this is more exercise than reality - I was trying to make
sense of the logic and obviously failed. That said - the initial goal
was to have the click of this particular object (a label) send focus
to the 2nd page in the tab control (Me.TabControl = 1). Then I started
thinking, it would be cool (since I am always finding ways to be more
lazy!), if, instead of having to move the cursor with the mouse to
each tab and click to navigate through the tabs, what if the user
could just keep clicking on the same object (in this case, a label) to
do so. You helped me with that. However, that circumvented the initial
goal. Now, if the tab control was currently focused on the fourth page
(Me.TabControl = 3), then clicking on the object would have to happen
through the four remaining pages, as well as the first page, before
getting to the second page - the initial goal of the object (defeating
the lazy part!). So here I was trying to choose between features - and
hoping I could figure out how to have my cake and eat it too.
I hope that makes a little more sense to you. Does it?
magmike