Access 2010 spinner control

etech0
etech0 used Ask the Experts™
on
Is there a spinner control I can use in Access 2010? (I mean that pair of buttons with an up/down arrow, that can change the value of another control.)
Where can I find it? I don't see it in the list of controls.
Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Commented:
There is not. You can create one using a textbox and two buttons. Just add a textbox (name it something like txtValue) and two buttons (btnUp and btnDown), then add code like this to the Click event of those buttons:

Private Sub btnUp_Click()
  Me.txtValue = Nz(Me.txtValue, 0) + 1
End Sub

Private Sub btnDown_Click()
  Me.txtValue = Nz(Me.txtValue, 0) - 1
End Sub

Or you can use a 3rd party control. I've used this one:

http://www.fmsinc.com/microsoftaccess/controls/components/spin-button/index.html

There are probably more, but be aware that using these sorts of controls in Access is unsupported, and there is no guarantee moving forward that they will work in Access. You're far better off using the native methods described earlier.

Author

Commented:
Okay. How can I get them to look like the spinner buttons (arrows...)? Access puts space around the text of buttons, so ascii letters would probably get cut off.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
Commented:
You can use the ArrowUp and ArrowDown images and assign them to command buttons.  These can be sized very small (.125) " is about the smallest that allows you to see the whole arrow.

Text at that size would get clipped, so I would use the buttons "ControlTipText" property if you wanted to display text with those buttons.
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Author

Commented:
Where can I find those images?
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
I have a subform (frm_Spin) that I add to my forms when I want to use a spinner.  See the attached.  Only key is that you must assign it to a control when you open the main form.  See the frm_UserSpinner Open event.

If you don't assign it to a control, the buttons will click, but the error handler prevents errors from firing.
Spinner.mdb

Author

Commented:
Hi! I will make buttons, with the ascii arrows.
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial