Go to next page command for tab control?

Niniel

Registered User.
Local time
Yesterday, 22:43
Joined
Sep 28, 2006
Messages
191
Hello,

Is there a way to program a Next Page button for a tab control that can be put in the form's header and that'll go to the next page, regardless of what page I am on?

Thanks.
 
This works great; it's for a tab control with 5 pages; adjust "if IngPageNo = " as required [your number of tabs minus 1]:

Private Sub Command6_Click()
Dim lngPageNo As Long

lngPageNo = Me.TabCtl0.Value
If lngPageNo = 4 Then
lngPageNo = 0
Else
lngPageNo = lngPageNo + 1
End If
Me.TabCtl0.Pages(lngPageNo).SetFocus
End Sub

[I didn't come up with it myself, I'm just sharing the solution. :) ]
 
Here you go

Code:
Dim intCurrPage As Integer
Dim intNextPage As Integer

intCurrPage = Me.YourTabNameHere.Value
intNextPage = intCurrPage + 1
Me.YourTabNameHere.Pages(intNextPage).SetFocus

You'll have to trap for errors (like clicking NEXT when at the last tab).
 
Thank you, Bob.

I'm fairly new to Access, to "trapping" for an error would be a bit of a problem for me. :) Fortunately, I found a solution elsewhere that doesn't require this, so I'll just use that.
Thanks for your assistance though, I appreciate it.
 

Users who are viewing this thread

Back
Top Bottom