473,387 Members | 1,624 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,387 software developers and data experts.

using the cur(time) to create tenths of a second

I am stuck. I can't get the program to show the tenths of a second correct. Any help would be appreciated! Here is the code:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Sub Form_Timer()
  5.  
  6. Dim curTime As Date
  7. Dim Valhours As Integer
  8. Dim valminutes As Integer
  9. Dim valseconds As Integer
  10. Dim valtenths As Integer
  11.  
  12. curTime = Time
  13. Valhours = Hour(curTime)
  14. valminutes = Minute(curTime)
  15. valseconds = Second(curTime)
  16. valtenths = Second(curTime) * 0.66
  17.  
  18. pgrhours.Value = Valhours
  19. pgrminutes.Value = valminutes
  20. pgrseconds.Value = valseconds
  21. pgrtenths.Value = Second(curTime) * 0.66
  22.  
  23. txthours = Valhours
  24. txtminutes = valminutes
  25. txtseconds = valseconds
  26. txttenths = valtenths
  27.  
  28. End Sub
Feb 21 '07 #1
1 1899
Killer42
8,435 Expert 8TB
I don't think the Date format in VB provides tenths of a second. I think the "granularity" is one second.

Also, how is taking two thirds of the number of seconds supposed to produce a number of tenths of a second? I copied your code, and it appears to work just fine (assuming you did want to show two-thirds of the seconds). For example, when the seconds were 45, the "tenths" showed 30.

You might need to play with the "tick count" or something.
Feb 22 '07 #2

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

Similar topics

2
by: deko | last post by:
I don't have access to the php.ini on my hosting provider's shared server and don't want to rely on cookies, so I'm wondering if this a reliable way to timeout a session: if (credentials are...
3
by: connieharper | last post by:
I have an ASP app that works as an online time clock. The user logs in and clocks in and out and the app records the time punches in an access 2000 database. My problem is this. I just setup a...
2
by: Jonas Granqvist | last post by:
I wonder if someone could help me with some sample code on how to make a simple application using time. How can I for instance make the program run the function "foobar()" every ten seconds? I've...
1
by: qUACK | last post by:
Hi, Can I set the default value for a field using sql in Access? Many thanks, Andy.
3
by: John | last post by:
Hi I am using the Create User Wizard and am getting the 'Password length minimum: 7. Non-alphanumeric characters required: 1.' error when trying to create a new user. What am I doing wrong? ...
17
by: OlafMeding | last post by:
Below are 2 files that isolate the problem. Note, both programs hang (stop responding) with hyper-threading turned on (a BIOS setting), but work as expected with hyper-threading turned off. ...
4
by: archana | last post by:
Hi all, I want to develop one windows service in which i want to provide some scheduling facility. What i want is to take start time frm one xml file and then at that specified start time. ...
6
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
1
by: assgar | last post by:
Hi I need help. I know what I want to accomplish, but I do not know how to do it. WHAT I NEED HELP ACCOMPLISHING: How to do I insert data into a table for a date range of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.