Spin button Control

  • Thread starter Thread starter Dynoduck
  • Start date Start date
Yes. Microsoft have. It's been available in Access since at least A2000.
(And I assume that it's essentially the same as the Excel 2007 one - which I
haven't seen). It's available from the More Controls ... list in the
Toolbox; it's called (in the versions of Access which I've got) Microsoft
UpDown Control (and there's possibly more than one version available).

HTH,

Rob
 
Thanks for the prompt response. I am unfamiliar with how to configure this
control to insert a number in another field on the form by clicking on the
increment or decrement arrows. Any advice on how to do this would be
appreciated.
 
It's pretty simple - all you need is a single line of code, in the UpDown
control's Change event. For example, this will display the value of an
UpDown control named UpDown0 in a textbox named txtSpinner:

Private Sub UpDown0_Change()
Me.txtSpinner = UpDown0.Value
End Sub

You can actually omit the Me. and the .Value - this also works:
txtSpinner = UpDown0

The only tricky bit is that the Change event for the control is not
available via the Events tab on the standard property box; you have to get
to it via the drop-downs in the VBA editor. In the Other tab of the UpDown
control's property sheet you can set the min, max and increment values, and
the spinner's orientation; you can also set these (in design mode) by
right-clicking the control and selecting UpDown Object - Properties.

Note also that the UpDown control has several properties for a "Buddy
Control". Sadly, these work only in VB, not in Access; see here:
http://support.microsoft.com/kb/284140

HTH,

Rob
 
Back
Top