How do I use tab to auto fill a textbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobT
    New Member
    • Aug 2010
    • 14

    #1

    How do I use tab to auto fill a textbox?

    Ok, here's what I've got.

    In the screenshot, you'll see three things- a start time, end time and total time. So the goal is this-

    A user puts in a current start time by hitting F1 at the start of shift. They tab across the end time to the "time field", then go across the row.

    Then they enter their case number, then hit F1 again, and it will enter the current time in the start box on the next row, as well as putting that time in the end box in the row above...

    And keep doing this down the whole form.

    I hope this makes sense. If anyone can think of a better way to do this, I'm all ears. I need help with the code.

    Sorry, I chose the wrong title because I've revised this question about 20 times.
    Attached Files
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    To enter the Time in a textbox=

    Code:
    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
       If KeyCode = vbKeyF1 Then Text1 = Time
    End Sub

    Comment

    • RobT
      New Member
      • Aug 2010
      • 14

      #3
      Sorry, I should have mentioned I'm using VB 2010. I tried that code and it gave a ton of errors. I've played around with some variations and nothing worked.

      Comment

      Working...