How to Use Spin Controls for Date or Time Fields

Top  Previous  Next

Spin Controls are commonly used for date or time entry controls. Using a SPIN control gives the end user more flexibility, allowing data entry by typing or by clicking on the up or down buttons to increment or decrement the value.

In the Window Designer:


Place a SPIN control on the window by clicking on the Spin icon in the Controls toolbox and then clicking on the desired position in the window.


RIGHT-CLICK on the spin control and choose Properties from the popup menu.


In the Use entry box on the General tab, type the field's label (or press the ellipsis (...) button to select the field from the Select Field dialog).


Select the Extra tab, and specify the Step value.

This is the amount by which the value is incremented or decremented when the Spin Control's Up or Down button is pressed. For a Date, a step value of 1 increments or decrements by one day. For a Time, a step value of 6000 increments or decrements by one minute.


Optionally, provide an initial value for the fields.

You can specify an initial value in the Data Dictionary or if you are using the Form procedure template or Save button control template, you can provide an Initial value by specifying it in the Field Priming on Insert dialog. To specify the current date, assign the TODAY() function to a date field. To specify the current time, assign the CLOCK() function to a time field.

If you always want spin controls for these fields, specify a SPIN control as the default Window control in the Field Properties dialog in the Data Dictionary.