Results 1 to 3 of 3
  1. #1
    radguy is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2014
    Posts
    32

    Creating Simple Code for a DblClick Event in a Form

    I would like to create simple code that tracks how long it takes a person to build a part. When the person using the database double clicks on a cell (complete rebuild of part(field in a table)) the code then looks at the event status of the part the person is working on and records something. There are 3 event statuses (start, pause, stop).

    There are 2 ways that I am keeping track of tools, Event Number and Ticket Number. The event number is the uniqueID for each event that will have a autonumber datatype. The Ticket Number will be used to track multiple occurrences of an event on one tool. ex. Taking into consideration if they pause the building process, holidays, and weekends, etc...[times they are not building the tool]

    If the event status = start, then a dialog box pops up and it say "Would you like to PAUSE or STOP making a part?".
    • If the person clicks PAUSE


      • the code updates the event status to PAUSE
      • and puts the time that it was clicked as the value in a cell (complete rebuild of part (field in a table))

    • If the person clicks STOP
      • the code updates the event status to STOP
      • It will enter the current date/time in the cell (complete rebuild of part (field in a table))
      • ex......Me.Complete_Rebuild_Of_Part=Now()


    If the event status = Pause (previously it was Start)
    • Create a new record in a table with the same part number and ticket number. BUT a new event number.
    • Take the previous time the part was paused and make it that time the new time for (start rebuild of part (field in a table))


    If the event status = Stop
    • Create a new record in the table that will have a new ticket number and event number.
    • so you can start tracking how long it takes to rebuild an entirely new part.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    What you are describing is complex to do. Their are a lot of variables.
    1. What determines when a person stops making a part?
    2. No need for Pause, just start and stop.
    3. I would that simply using something with a Status of either InComplete or Complete would suffice.
    Of course I don't understand all of your Schema.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    As the Burrina points out - you are making it difficult on yourself... A start time field and a stop time field - is simple to calculate the difference. But the pause is the issue. First you must have an Unpause/Restart button too or it simply cannot be done accurately. You would have to write to a table with a common ID (perhaps the part), the code (Start, Pause, Unpause, Stop), and the time - but its key that you also write a Linking ID to couple the sequential start & stops in order to group them for math

    Part Code Time LinkID
    Widget Start 10:00 1
    Widget Pause 10:05 1
    Widget UnPause 11:00 2
    Widget Pause 11:15 2
    Widget UnPause 11:30 3
    Widget Stop 11:45 3


    then you will still have a tricky summing logic to deal with those that have no pauses, 1 pause, 2 pauses, etc..... but I suppose it can be done .

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

Similar Threads

  1. Help with Validation code on exit event on a form
    By thebionicredneck2003 in forum Programming
    Replies: 2
    Last Post: 05-17-2013, 06:04 AM
  2. Replies: 19
    Last Post: 04-23-2013, 10:08 AM
  3. Help creating a simple form
    By mattmurdock in forum Forms
    Replies: 3
    Last Post: 06-18-2012, 11:27 AM
  4. How to put code in form event.
    By rogdawg in forum Forms
    Replies: 4
    Last Post: 08-06-2010, 03:38 PM
  5. Simple Nav Form Code Not Working
    By alsoto in forum Forms
    Replies: 10
    Last Post: 04-10-2009, 09:30 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