Results 1 to 3 of 3
  1. #1
    Haleakala17 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    36

    Add Timer in Access Form and store data in a table


    All,

    I am requesting if anyone can help me insert a timer in the PropertyFrm Form in the Access Database attached to this message. When a user opens the PropertyFrm form I want the timer to record the number of hours, minutes, and seconds each user spend time on a record including the current dateand have the data stored in the Timer table. When a user goes to another record, I want the timer to reset and store the hours, minutes, seconds, and current date on another record in the Timer Table and so on. If the fields and data types in the Timer table is not created properly, please feel free to make modifications.

    I do not want the time and current date to be displayed on the PropertyFrm Form. I want the information to be stored in the Timer table.I do not want the user to see the hours, minutes, seconds and current date information on thePropertyFrm Form

    I appreciate your time and I will be waiting for your reply.

    Haleakala17
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,618
    Consider:

    Change fields in Timer table to DateTimeRec and ParcelNum1.

    Code behind form:
    Private Sub Form_Current()
    CurrentDb.Execute "INSERT INTO Timer(DateTimeRec, ParcelNum1) VALUES(#" & Now() & "#, '" & Me.ParcelNumber1 & "')"
    End Sub
    Private Sub Form_Close()
    CurrentDb.Execute "INSERT INTO Timer(DateTimeRec, ParcelNum1) VALUES(#" & Now() & "#, 'Close')"
    End Sub

    Query:
    SELECT Timer.ID, Timer.ParcelNum1, Timer.DateTimeRec, Query1.DateTimeRec, DateDiff("s",[Timer].[DateTimeRec],[Query1].[DateTimeRec]) AS Seconds
    FROM Timer LEFT JOIN (SELECT [ID]-1 AS ID2, Timer.DateTimeRec
    FROM Timer) As Query1 ON Timer.ID = Query1.ID2
    WHERE (((Timer.ParcelNum1)<>"Close"));

    Note this query assumes no gaps in the pk ID sequence.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Haleakala17 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    36
    June 7,

    You are a savior! I appreciate your help again. I have started learning some VBA so I hope I get better in the future. I appreciate your help

    Thank You,

    Haleakala17

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Simple 30 second countdown timer on Access 2003 form
    By Mediaman09 in forum Programming
    Replies: 2
    Last Post: 09-21-2011, 09:55 PM
  2. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 AM
  3. Store data in Excel automatically is that possible
    By drumaster in forum Import/Export Data
    Replies: 2
    Last Post: 04-27-2011, 03:28 PM
  4. Timer routine in Access 2007
    By bcmarshall in forum Access
    Replies: 4
    Last Post: 04-25-2011, 04:23 PM
  5. Replies: 2
    Last Post: 11-30-2010, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums