Color scheme: Dark
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Data editors » WklSpinEdit

WklSpinEdit

WklSpinEdit is a number box with up and down arrows, limits, a step size, and an optional unit, for values such as a session length in hours or a key's lifetime in days. You bind it like an Access text box, and it's saved with the record. The same editor is available as a column type in WklGrid, WklTreeList, and WklGantt (Editor = wedSpin).

Get started

None

Common tasks

Visual aid

+- frmKey: Form View --------------------------------------------------+
|  Key lifetime   [ 365 days                              |^|]         | 1  2
|                 [                                       |v|]         |
|  Session length [ 7.5 hrs                               |^|]         | 3
|                 [                                       |v|]         |
+----------------------------------------------------------------------+
RegionMeaning
1The number with its unit (Unit “days”), bound through Control Source just like a text box
2The arrows: one Step up or down, never past MinValue/MaxValue
3A number with decimal places (Step 0.5, DecimalPlaces 1)

Key features

  • Binds like a text box: Access writes the field to Value whenever the record changes; the user's change marks the record as dirty and is saved with it; an empty field is Null; and Esc undoes the change.
  • Never outside the limits: the arrows, Up/Down (one step), Page Up/Page Down (ten steps), and the mouse wheel all stop at MinValue and MaxValue.
  • Rejected like a validation rule: typed text that isn't a number or is outside the limits isn't saved. When the user leaves the field, the value from before the edit comes back, and InvalidEntry tells the form why.
  • A unit after the number: Unit is display text only; the field stores just the number.
  • Screen readers announce a spinner named by Caption, with its range (UI Automation RangeValue), a real edit field, and two real buttons.

Core concepts

Access saves the field, just as for a text box. The control reports each valid change to Access, which marks the record as dirty and copies the control's value to the field when the record is saved. A value set in code (Value) is only displayed.

The limits check user input, not stored data. A value from the record or from code is shown as is, even if it's outside the limits, just as an Access field's validation rule doesn't check data that's already stored.

Access keeps its own properties. Enabled, Locked, Visible, TabStop, and the tooltip are the standard properties that Access gives every control.

Administration

Troubleshooting

None

For developers

None

en/wiki/msaccess/comctl/data-editors/spinedit/start.txt · Last modified: by Wolfgang van der Stille