Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2004, 09:49 AM
Authorized User
 
Join Date: Sep 2004
Location: Twickenham, , United Kingdom.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Paulsh Send a message via Yahoo to Paulsh
Default Stop Watch

I am trying to record a record in a database each time I hit the enter button. I want to record a DATE/TIME field but more specifically I just need the extended time. In other words hh:mm:ss:ss where the final two "ss" refer to the miliseconds. Is this possible and if so, how do I achieve thsi.

Thanks in advance.
Paul

__________________
Paul
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2004, 09:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried the GetSystemTime API call?

Here's the entry from the API Guide:

Code:
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'KPDTeam@Allapi.net
    Dim SysTime As SYSTEMTIME
    'Get the system time
    GetSystemTime SysTime
    'Print it to the form
    Debug.Print "The System Date is:" & SysTime.wMonth & "-" & SysTime.wDay & "-" & SysTime.wYear
    Me.Print "The System Time is:" & SysTime.wHour & ":" & SysTime.wMinute & ":" & SysTime.wSecond & ":" & SysTime.wMilliSeconds
End Sub

Brian Skelton
Braxis Computer Services Ltd.
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2004, 11:06 AM
Authorized User
 
Join Date: Sep 2004
Location: Twickenham, , United Kingdom.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Paulsh Send a message via Yahoo to Paulsh
Default

Thank you very much. This works a treat.
I now have the challenge of determining how to maniputate SYSTEMTIME variable within a database record.

Reply With Quote
  #4 (permalink)  
Old September 22nd, 2004, 12:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure why you need the milliseconds, so I may be totally off base, but I would probably hold the standard date/time data in a date time field and then create a seperate integer field to hold the millisecond data.


Brian Skelton
Braxis Computer Services Ltd.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop button won't stop loop JDShaffer Visual Basic 2008 Essentials 3 May 23rd, 2008 03:22 PM
Stop watch rohit_ghosh Access VBA 2 May 3rd, 2007 04:14 AM
Watch Window is disabled LaFeverMF ADO.NET 1 July 21st, 2004 11:32 PM
JS/ASP watch mega Javascript 5 April 29th, 2004 03:03 PM
digital watch StreetSweaper C# 3 December 30th, 2003 05:00 AM



All times are GMT -4. The time now is 04:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.