+ Reply to Thread
Results 1 to 2 of 2

Creating a stop watch on my VBA form & Combo Box items dissapear after pressing submit.

  1. #1
    Registered User
    Join Date
    02-14-2017
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    10

    Thumbs up Creating a stop watch on my VBA form & Combo Box items dissapear after pressing submit.

    So I have created a basic tracker for users in the office for what they are doing throughout the day, the form submits the data to s spread sheet.

    My first & main issue is my combo box, everytime I submit the information to the spreadsheet and then return to the form and the combo box items have dissapeared? Anybody any ideas?

    Also you can see from my tool I ask the user to enter the time they entered the given state and how many minutes the spent in it, I'm looking for an alternative to this - my idea is to create a stop watch for when the user enters the state they can start the clock, then when they leave the state they can stop the clock or perhaps even a button to take note of the time value, then a button again that takes note of the 2nd time value, the first time value will act as the state start time & the second will act as the state finish time.

    Thank you to anybody that can offert their assistance
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Creating a stop watch on my VBA form & Combo Box items dissapear after pressing submi

    I got into this and things sort of got away from me. I did a lot of revision.

    First of all there is the tables sheet. This sheet has three things:

    A table of agent names. You can maintain this list with any amount of names. No need to add the names to the code.

    A table of States. Ditto.

    Some helper cells.

    The selected agent is in Cell F1.

    Cell F2 figures out the maximum date/time for the agent.

    Cell F3 is a composite of the agent’s name and the maximum date. This matches the helper column in the Data table.

    Cell F4 finds the row for the latest date for the agent

    Cell F5 is the current state.

    Cell F6 is the time the current stat was initiated.

    The button now launches a new form that only gets the agent name. When you click the continue button, the selected agent’s name is written to cell F1 on the Tables sheet and the calculations happen.

    The button also launches the Tracker form. My apologies, my naming convention is backwards from yours: I put the type of object first and then the name.

    The tracking form gets most of its information from the table sheet. It assigns the current time as the end time and computes the minutes spent.

    Enter in the new state, who approved and click the submit data button.

    The submit data button looks for the old current state and if it finds it fills in the end time and minutes spent in state.

    It also adds the new state as a new record.

    The only issue is that the minutes spent won’t work over midnight. I need to know how you want to resolve this. I can do two things. I can include the date and the time so you’ll get the number of minutes between the last thing you did yesterday and the first thing you did today, or I can detect if it is a new day and start fresh each calendar day. Which do you prefer?

    Also, instead of minutes spent in state, I could present the time as hh:mm.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Stop watch!
    By atif_ar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2017, 04:26 PM
  2. Click Button to start/stop a Stop Watch
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2016, 01:25 PM
  3. stop watch
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2014, 01:09 PM
  4. Replies: 0
    Last Post: 11-20-2013, 10:30 AM
  5. [SOLVED] Clearing a Combo Box then trying to submit user form to Workbook gives error messages
    By colvinb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2012, 02:18 PM
  6. Replies: 1
    Last Post: 02-05-2012, 09:31 PM
  7. Exiting form removes all items from my Combo Box?
    By Wongadob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2011, 07:53 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1