Time stamp

stuartandwil

Board Regular
Joined
Nov 24, 2002
Messages
104
I have previously accomplished putting start/end times on a fault log using Excel. When a machine is selected a start time is put in a cell and when job complete is selected it puts an end time in another cell. It then calculates the difference to give a job time. Can I accomplish the same sort of thing in Access, because there are going to be a few thousand records and obviously Access can handle it better or can it ? Neew to have time go in automatically without keyboard entry.

Many thanks
:rolleyes:
Stuart
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Timestamp

If you first create a new table, 'synctable', with one field, call the field 'lastsynctime' and give it the type Date/Time. Then save the table and open a new Update query. Show the table 'synctable' you have created and select the property 'lastsynctime' and in the update column write Now().
Once you run the query through a piece of code or a macro or by clicking on it the query 'lastsynctime' will be time stamped.

I hope this is what you want. :)
 
Upvote 0
The problem with the previous answer is that you won't have a log, the database will constantly update all the values when you run the update. Another way to do this would be to create a table with 3 fields: ID(autonumber), Start_time(date/time), and End_time(date/time).

I assume you will need a form of some kind, but after re-reading your post I'm not real sure of when you want to store the data. What do you mean by "when a machine is selected"

-gator
 
Upvote 0
Something along the lines of Pick from list a machine(drop down)i.e. machine 1, machine 2, machine 3. When selection as been made move the current time into a field. When the job is complete select from Yes/no when yes move current date into different field.

Then with sums extract the downtime of the machine. The difference between the 2 times. The times once entered must remain static.

Many thanks :)
 
Upvote 0
Hi stuartandwill,

Create a textbox for start and end on the form of interest (txtstart, txtend)

Try code like this for your combobox:

<FONT color=blue>Sub </FONT>Combobox1_Afterupdate()</font>
    txtstart = Format(Now(),"MM/DD/YY")<FONT color=#008000>'adjust format to your needs</FONT>
    <FONT color=blue>If </FONT> Me.Dirty <FONT color=blue>Then </FONT>Me.Dirty =<FONT color=blue> False</FONT>
<FONT color=blue>End Sub</FONT>

and then for the job complete choice (the object from which you make this choice is not stated, so I'll use ChkComplete)

<FONT color=blue>Sub </FONT>ChkComplete_Change()
    txtend = Format(Now(),"MM/DD/YY") <FONT color=#008000>'adjust format to your needs</FONt>
    <FONT color=blue>If </FONT>Me.Dirty<FONT color=blue> Then </FONT>Me.Dirty =<FONT color=blue> False</FONT>
<FONT color=blue>End Sub</FONT>

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,522
Messages
6,160,308
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top