Consulting

Results 1 to 6 of 6

Thread: Assistance With Building Timer to Track Test Runs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Assistance With Building Timer to Track Test Runs

    Hello everyone. I am trying to build an Access Database to create records each time we run a test case(SimMode) and track how long it takes the SimMode to turn on(AgeIn) and turn off(AgeOut). The issue I am having right now is that I only need/want seconds/milliseconds to be displayed and I feel like I'm hitting a wall .

    So to break it down I have two questions.

    1) How can I get my data to store into Access as 00:00.00?

    2) How should I go about building this stopwatch/timer?


    Ideally I would thrilled if I could control the timer with one button. i.e. MouseClick down to start and MouseClick Up to stop.


    Side Note: I'm an absolute amateur but I am desperately trying to improve my skills. (see horrible code below)

    Any help would be greatly appreciated

    Private Sub Command51_MouseDown()

    Dim StartTime As Date
        Dim StopTime As Date
    
    
        StartTime = Now()
    
    
        Expression.MouseUp
    
    
        StopTime = Now()
    
    
        AGEIN = StopTime - StartTime
    
    
    
    
    End Sub
    Also tried this one with two buttons. It seems to work down to the second but I would also like the value to be stored as seconds/milliseconds in my database if possible

    Private Sub Command51_Click()
    
    
        AGEIN = Now()
        
    End Sub
    
    
    Private Sub Command52_Click()
    
    
        Dim StartTime As Date
        Dim NewTime As Date
        
        StartTime = AGEIN
        
        AGEIN = Now() - StartTime
        
    End Sub
    Last edited by chaserankin; 02-24-2022 at 08:06 PM.

Posting Permissions

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