Unanswered: Need to create a form to log the start, end and pause time for a task?
I am creating a productivity database in Access 2003 and need the user to log via a form when they start and end a task. I have got the basic form up and running, but now I need to incorporate a pause button, along with logging the reason for pausing the task.
I am new to Access so have been working my way through a skill port course, the help file and google this is how I have done it so far on the form:
I have a button labelled "Start Task" with the following code set to the onclick event:
Private Sub Command11_Click()
[Time Started] = Now()
Me.Command11.Caption = "Timer Running"
When they have finished a task they click another button lablled "End Task and Submit" with the following code set again on the onclick event:
Private Sub Command12_Click()
[Time Finished] = Now()
msg = "Are you sure you want to end this task and submit?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "End Task and Submit"
Response = MsgBox(msg, Style, Title)
If Response = vbYes Then
Me.Command11.Caption = "Start Task"
DoCmd.GoToRecord , , acNext
When they press this it resets the caption on the first button and moves to the next blank record.
I need to somehow incorporate a pause function into this, and record the total time paused separately along with a reason for the pause. The reason would be selected from a drop down box.
The pause functionality is causing me the head ache, I don't think my initial solution is the best, and my knowledge is still quite limited so there is probably a much more simple solution out there.
Any help on the code I would need to be able to integrate the pause functionality would be greatly appreciated or if Access has built in functions that I could use?
The managers want it so that the task they are supposed to be doing is only logged once within the database, and if someone has to stop the task for any reason i.e a colleague asking for help they can pause it select the reason and then continue when they have finished.
They ultimately want to be able to query the database to see which employees are asking for help from others, so that they can provide coaching or additional training. They also want to see how many hours of productivity people are loosing as a result of this.
I haven't set that table up but it seems a good idea, I could then build queries and reports specifically for the pause time.
On the pause table would I need to set up a foreign key linking to the primary key on the table where the work times are logged? Or would just creating a one to many relationship between the tables be enough?
My form is linked to the main table, so to create the pause buttons I'm thinking I need to create a subform and link that to the pause table, does that sound right?