Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wizard Interface

Status
Not open for further replies.

ianbar

Technical User
Jan 10, 2003
69
GB
I am creating a wizard interface for completing a form, does anyone know the vb code to show the next tab when clicking on a cmd button? So I can have Next and Prev buttons. Thanks.
 
I'm not sure what kind of wizard you're doing but maybe you could look at this code to create Previous and Next buttons for a form: (In the following, Type is the field you're searching on)

Sub NavByType(Direction)
Dim R As RecordSet
Set R = Me.Recordsetclone
R.Bookmark = Me.Bookmark
If Direction = "B" Then
R.FindPrevious "[Type] = '" & Me![Type] & "'"
Else
R.FindNext "[Type] = '" & Me![Type] & "'"
End If
If R.NoMatch Then
Msgbox "No More Matches"
Else
Me.BookMark = R.BookMark
End If
End Sub

On your command button for Previous, on the On Click type
NavByType Direction:="B"

On your command button for Next, on the On Click type
NavByType Direction:="F"
 
Sorry I should have made myself clearer. I was using a tab control. I have sorted it out now. Thanks for the reply anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top