How to create a timer/stopwatch with different codes?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JDav89
    New Member
    • Aug 2012
    • 1

    How to create a timer/stopwatch with different codes?

    I have agents that use a phone that they enter an aux code (1-9) which lets me know exactly what they are doing at the moment. Being that they are using a phone it's possible for them to select the wrong number and they wouldn't know which aux state that they are in because the phone doesn't show them. I wanted to create almost the same thing in access but do not know where to begin. I would like to provide them which buttons to click and the timer starts when they log in and allows them to change what state they are in throughout the day. I will like the total time to add together at the end of the day and how much elapsed in each aux state as well. Is this even possible?

    I'm really new to access and just learing about coding.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    JDav89,

    Welcome to Bytes!

    My first thought is that this is very possible and shouldn't be "too" difficult for a beginner. How much experience do you have with Access? Of course, this would require quite a bit of coding, so you should be prepared.

    Do some research on databases and what they can do and how you should approach it. I can't tell you how good these over views are, but a place to start may be here:

    Database Lessons

    Your requirements don't sound terribly tricky, but it all depends on how tricky you will need it to be. If it is simply a work time computation app, then, it might be pretty simply, in which you just have the user begin the db at the start of the day, selecting whichever state they are in. The db would calculate time elapsed based when they click the buttons and could compile a report at the end of the day/week/month, by user.

    Have you tried to p[ut anything together yet? If so, most on this forum are glad to guide you through some of the process, although we won't do the work for you.

    Looking forword to working with you.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      Although I am sure the site Twinnyfo suggested is a good one.

      I suggest that first time DB developers start with something along this line first: A Tutorial for Access This site starts from the basic thought process for design and then covers the basic table building concepts etc...

      Once you have that down... then start with the coding.
      Something that I've learned from Rabbit here, is that I rely way too much on the VBA to get my results!

      Oh, and yes, this is possible in Access.
      One thought would be along the lines of:
      Build your tables
      Build your forms
      The buttons could save the time clicked into a record along with user information and state
      The queries can build the time difference.

      -z
      Last edited by zmbd; Aug 29 '12, 05:47 PM.

      Comment

      • TheSmileyCoder
        Recognized Expert Moderator Top Contributor
        • Dec 2009
        • 2322

        #4
        In theory these things sound quite simple, but in reality they are usually a bit more complex, since you (probably) need to take into account such issues as users forgetting to clock out (This could be partially fixed by code running when the database closes, allthough this doesn't work if the user does a Standby on his PC.

        I think the simplest approach I can imagine (well I spend a whole 30 seconds thinking about it) would be to have a login form (Or autologin based on username used on computer). After login, detect if this is the first entry for the day, and if so create a new record with a combined primary key consisting of Date and UserID. Then open a Form and navigate to the record.

        Add a combobox (or buttons) in which the user selects his "state", and through code you can now add a new related record with foreign key Date and userID and its own start/stop time.
        When user selects a new state simply add a new sub-record for that day/userID combination. The states for the day could be shown in a subform, and if required could be left open for manual editing.

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3653

          #5
          Smiley brings up some key points in his first paragraph, but if the users are diligent about logging in, using the forms and logging out and then shutting down, things should work ok. But, sometimes I find it easier to train monkeys than get users to do what they are supposed to do in a database...

          Comment

          Working...