Article ID: 116118
Article Last Modified on 10/10/2006
' Defines variable called "OldSpin" as an integer, and makes it
' available to all subroutines.
Public OldSpin As Integer
' This routine is assigned to the spinner to run when you choose the
' spinner. It will determine the difference between the current
' spinner value and OldSpin, and use the difference to increment or
' decrement the date in the edit box.
Sub SpinDate()
' Sets the edit box value based on the difference
' between OldSpin and the spinner value.
DialogSheets(1).EditBoxes(1).Text = _
DateValue(DialogSheets(1).EditBoxes(1).Text) - OldSpin + _
DialogSheets(1).Spinners(1).Value
' Resets OldSpin to the spinner value.
OldSpin = DialogSheets(1).Spinners(1).Value
End Sub
' This routine initializes the spinner and OldSpin to a value of
' 15000, populates the edit box with today's date, and displays the
' dialog box.
Sub ShowDialog()
' Sets OldSpin to 15000.
OldSpin = 15000
' Sets the current spinner value to 15000.
DialogSheets(1).Spinners(1).Value = OldSpin
' Sets the edit box to today's date.
DialogSheets(1).EditBoxes(1).Text = Date
' Displays the dialog box.
Dialogsheets(1).Show
End Sub
spinner controls
spinners, creating
spinners, creating
Additional query words: 7.00a 5.00a 5.00c XL98 XL97 XL7 XL5 XL
Keywords: kbhowto kbprogramming kbdtacode KB116118