Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Buttons to bump a number up and/or down (2000)

    Is there a tool to add and/or subtract 1 to a number field while a command button is depressed? I have a field for Miles (of a vehicle as reported at trade) which must be updated when the vehicle is later offered for sale. Since having to re-enter up to 6 characters, there is a high probability of input error. I have included a check that alerts if the miles are lower than previously reported, but would prefer to just have a command button to add what is often less than 10 additional miles.

    Any input would be appreciated.
    Kathi Mills

  2. #2
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Buttons to bump a number up and/or down (2000)

    Dim i As Long
    i = MileageTextboxName
    i = i + 1
    MileageTextboxName = i
    Put this is the click event for your button.
    Paul

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Buttons to bump a number up and/or down (2000)

    Paul,
    Thanks for responding. Your solution was one that I had considered, however I don't think it works without clicking 10 times to add 10 miles. What I'm looking for is something that lets the "add 1" loop for as long as the button is depressed. I'm thinking maybe a combination of KeyPress, KeyDown, or KeyUp is possible but I've never even noticed them before. I've seen the type of thing I'm trying to accomplish in so many non-Access applications. I'll keep plugging away -- with the utmost confidence, of course <img src=/S/clever.gif border=0 alt=clever width=15 height=15>
    Kathi

  4. #4
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Buttons to bump a number up and/or down (2000)

    I'm relieved to report that my confidence was not ill-placed. Put the code (me.miles = me.miles + 1) in the OnClick property, changed the AutoRepeat property to "Yes" and added a DoCmd.Repaint. Now it is EXACTLY what I wanted.
    Thanks!
    Kathi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •