Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2005

Tip: Looking for answers? Try searching our database.

START AND STOP TIME ENTRY

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 17 Jan 2005 01:54 GMT
I have a form in which I wish to automatically capture a start time and the
actual stop time of an entry.  I have tried several different approaches but
cannot get the stop time accruate without manual entry.  Ideally I'd like to
stop time when the record is closed or a new record opened - there will be
multiple users.  Any ideas?
Steve Schapel - 17 Jan 2005 04:33 GMT
Jim,

Would the Before Update event of the form do the job?  Or the After
Update event?

Signature

Steve Schapel, Microsoft Access MVP

> I have a form in which I wish to automatically capture a start time and the
> actual stop time of an entry.  I have tried several different approaches but
> cannot get the stop time accruate without manual entry.  Ideally I'd like to
> stop time when the record is closed or a new record opened - there will be
> multiple users.  Any ideas?
SJ McAbney - 17 Jan 2005 10:47 GMT
In your form's module, put this declaration to the top (just under Option
Compare Database)

Private Declare Function WWindowsStart Lib "WINMM" Alias _
   "timeGetTime" () As Long
Dim lngTimeStart As Long
Dim lngTimeStop As Long

In the form's Current event, put:

lngTimeStart = WWindowsStart

In the form's BeforeUpdate event, put:

lngTimeEnd = WWindowsStart
Me.MyTextBox = lngTimeStop - lngTimeStart

Where MyTextBox is the name of the textbox you want to store the value in.
The value returned is in milliseconds.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.