Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011

    Unanswered: Keydown increase value

    I have a field named Letters where I want to be able to increase the number by one every time I use the keydown function. I have done this in the past but it escapes me how I did it. I guess also the value if I use the keyup key for a greater and the keydown for a lesser value. Using the arrow keys on my keyboard to be clear. Up increase and down decreases.

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Just replace TargetControl with the actual name of your Textbox:
    Private Sub TargetControl_KeyDown(KeyCode As Integer, Shift As Integer)
      Select Case KeyCode
       Case vbKeyDown
          Me.TargetControl = Nz(Me.TargetControl, 0) - 1
       Case vbKeyUp
          Me.TargetControl = Nz(Me.TargetControl, 0) + 1
      End Select
    End Sub

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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