How to increment value in bound control using + or - keys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a bound text box I am dislaying a default numeric value, when the control
has focus I would like the user to have the ability to increment or decrement
the value with the + or - keys.
Thanks
 
clipper,
If the control is named MyNumVal, on the Minus button Click event....
If MyNumVal = 0 Then
Exit Sub
Else
MyNumVal = MyNumVal -1
End If

For Plus...
MyNumVal = MyNumVal -1

IfMyNumVal can go less than 0, then remove the IF for 0

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top