Article ID: 141566
Article Last Modified on 11/23/2006
Public x As Integer
Sub ShowDialog()
' Start with Dialog two.
x = 2
Do
' Show the Dialog; if Cancel is pressed, exit the Do Loop.
If DialogSheets(x).Show = False Then Exit Do
Loop
End Sub
Sub PreviousDialog()
'Hide the current dialog
DialogSheets(x).Hide
' Sets the index to one previous.
x = x - 1
' Test if we are going to show the first dialog box.
If x = 1 Then
' If it is the first dialog box, then disable the Previous
' button.
DialogSheets(x).Buttons("Previous").Enabled = False
End If
End Sub
Sub NextDialog()
' Hide the current dialog box.
DialogSheets(x).Hide
' Sets the index to one next.
x = x + 1
' Test if we are going to show the last dialog box.
If x = DialogSheets.Count Then
' If it is the first dialog box, then disable the Next button.
DialogSheets(x).Buttons("Next").Enabled = False
End If
End Sub
Keywords: kbcode kbhowto kbprogramming KB141566