Stopwatch in access (1 Viewer)

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
Hi everyone,

I am created the stopwatch form in my access db but:

What I am trying to do is the same, except it is on a continuous
form. So if it is a task form and there are five tasks(five different record), each form would have a seperate stopwatch, to include a bound field for the
ElapsedTime. The idea is to record each time spend on each task(record) and they need to be somehow separated.

Form Problem is: When I click on 'Start' for the first record
(Task 1) the ElapsedTime begins as expected. When I click 'Stop' the
ElapsedTime stops as expected and is correct and than press enter and thats time going to the record in my database.

When I click 'Start' for the second record (Task 2) the ElapsedTime
starts at the time where Task 1 left off. Or if i go to the previous record and press stop i will also stop the time for Taks 2. Is there a way to make the stopwatch timer in Task 2 is not influenced by Task 1?

Best regards my lifeguards :)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
To track times for each record you'd need to use bound fields for the start and stop times, not just the elapsed time (or instead of). Or you could use a temp table to store record-specific start and stop times and the store the elapsed time as you do now.

FYI I moved your thread out of the introductions forum since it had a technical question in it.
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
pbadly,
I have bound fields for the start and stop times which is related for each record in the data base. Problem is how i can start thing when i go to the previous record on form and click on start time and then next previous record (which is stoped) then in that record time also start to counthing. I just need when i click on my stopwatch in form and when is time counthing in record when is time stopped in previous record to be stopped.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
Are you clicking on something within each record, or something on a main form? You haven't shown the code, but I'd expect it to be record specific. Can you attach the db here?
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
I'm uploaded db. Just to be clear to you. I deleted log in form because then my db can't be uploaded because db is > 2mb :) i try to commpresed but still is >2mb and now is ok
 

Attachments

  • Evidencija 3.accdb
    1.4 MB · Views: 105

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
What are the steps to recreate the issue? The records in your table appear to have different values for txtActualSeconds.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
I'll add that your timer event is affecting unbound controls, so if you change records while the timer is running those will no longer match the displayed record. Also the only code to end a timer is behind a non-existent button.
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
Yes and that is ok. Need to be different seconds or minutes. Problem is try to do this steps: Click on form Evidencija skeniranja then button Pause/Repause you will see that time will start to count and then you click on Previuos button(in the middle) you also see that time counthing for that record and i dont want to counthing because i do not click to count on that record.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
The problem is you're using unbound controls to keep track, where you should use bound controls. In your timer event, I'd use Now() and the bound start time to calculate the elapsed time. I personally wouldn't try to store the "actual" times until the record is complete.
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
Pbadly my friend i need that actual time because when he/she work on some project i need to now how much he/she actual time needed to finish the project. If you have some idea how i can solve the problem what i have i will be very grateful to you. You should add some bound controls or what do you think that will be the best solution for my db.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
Would it make sense to track each start/stop as a separate record in a related table? As is, you'd know when they started and stopped overall but the elapsed time wouldn't match if there were pauses.
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
That means that when they start and then(they go for lunch) and press stop that means that I need to calculate how times they spend for pause? Is some possible that can be automaticaly calculated?
 

Bojan1988

New member
Local time
Today, 15:43
Joined
Nov 4, 2018
Messages
8
Hi Pauel,
How are you my friend? I hope you are well. Do you try to do something with my project?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:43
Joined
Aug 30, 2003
Messages
36,124
Sorry, I'm out of town so haven't gotten back to this. I'll try to look at it tomorrow.
 

Users who are viewing this thread

Top Bottom