473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to create stopwatch in access and save result in a table

Hi ..
I need to create a stopwatch form in Microsoft access and when stopping the stopwatch I can save the result into a table so that I can later do calculations on this result .. can any one please help me doing this ?
Dec 16 '15 #1
3 3316
zmbd
5,501 Expert Mod 4TB
That's not what Access, or really any database, was intended to do.

You could use the form's on_timer event, set to 1000 which would trigger the event every second (the event is in milliseconds)
Three buttons (maybe toggle the first two here?):
one to set the timer event to 1000 (start)
one to set the timer event to 0 and save your record (stop)
one to reset the timer and display.

Form level variable to hold elapsed times

procedure to be executed every time the timer event triggers to store the loop count to the form level variable. This way each time the event triggers the variable is incremented by 1 second. I would simply store the elapsed time as seconds as one can calculate what you need from there....
Dec 16 '15 #2
Rabbit
12,516 Expert Mod 8TB
I agree with the overall design. However, I wouldn't use a loop counter in the timer to keep track of elapsed time. The timer event isn't guaranteed to fire at exactly 1000 ms after the last time it fired, it could take slightly longer. So over time it gets further and further out of sync with the actual elapsed time. Plus it takes cycles to run the code within the timer event itself. Instead, when the timer event is started, log the timestamp and use the timer event to calculate the current timestamp against the variable.
Dec 16 '15 #3
zmbd
5,501 Expert Mod 4TB
I had thought about pulling the time stamp; however, I wasn't sure of the time lag - in principle, I agree with Rabbit's modification.

The path to follow may depend on the degree of acceptable error in the time measurement.
Dec 17 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Vikaspell | last post by:
I have a 2 dimensional table which i want to create in access. this full table i want associated with 1 primasry key or ID how can i do this currently i am entering the table in excell and linking...
3
by: James Wong | last post by:
Dear all, I have an old VB6 application which can create and access Excel object. The basic definition statements are as follows: Dim appExcel As Object Dim wkb1 As Excel.Workbook Dim wks1...
2
by: groupy | last post by:
Hello all, my question might be trivial but since my background isn't DB i'll dare to ask it any way: how to create a real (not virtual) table from view1 & view2 ni sql server? what should i...
1
by: RookieDan | last post by:
Greetings fellow Accessers! Im new but in Access, but I have some background in different coding. I have a programme loading customer data into Access belonging to BMW dealers in Europe. ...
1
by: jdoverton | last post by:
Hey, I need to save a table under a New Table Name while in Access VBA. I need to conserve the properties and Column names from one table to the new table. Any suggestions? Thanks much,...
2
by: nospam | last post by:
Hello, I am using Access 2000 and SQLServer 2000. I have 2 tables - one in Access and one in SS. They are identical in structure. I want to copy the Access or local table ( table_local) to...
1
by: ATSPSoft | last post by:
Hi, I'm newest in c#.. i need to create an Access MDB file... Supose that my MDB file is "mymdb" and my table is "mytableA" with 2 fields like "field1" as integer and "field2" as string How...
10
by: AAaron123 | last post by:
I want to create a database with one table on the host. I can't user SQL Server Management Studio to do it so I guess I have to do it programmatically. I have in mind that in the session start...
1
by: rotaryfreak | last post by:
Hi, I'm new to ruby and i've been experimenting on different ways on how to do this, but sadly nothing is working. I would like to create a multi-dimensional hash table in which i can access my...
1
by: marinas908 | last post by:
I am declaring a cursor with union on two similar tables, during fetch i use 1st table dclgen and fetch into those columns. My result table is a correct union of two tables. The problem is the first...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.