Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count down CLock

Status
Not open for further replies.

withoutaclue

Programmer
Aug 28, 2002
31
0
0
GB
I want a form where i type in a date (Ie 25 december 2002)

I then want to click a button where anouther box, appears names me how many Months and days From now untill that date,
is left

I presume it would be something clike NOW - Mydate

(and then if possible, be active so it will then tell me, the hours, minutes and seconds left as well)

So in a way it is a count down timer!!

Im starting from scratch, so if any one has any ideas, it would be great

Many thanks
 
Sorry if I'm a little lazy but if you look up the DateDiff and Format functions in the help file, you will have something to start on.

Rewdee the Lazy One
 
In the Form's OnTimer event put code that does the calculation and then sets the values of the controls:-
MonthsLeft
WeeksLeft
DaysLeft
HoursLeft
MinutesLeft
SecondsLeft

In the TimerInterval property put 1000 and it will update every second.


However, you'll need to sort out in your own mind the definition of a month left, week left etc.

If MyDate = 1st December and NOW() = 30th November is that ONE MONTH still left ?

How will you calculate what YOU mean by one month, etc.

You can use the Month(Now()) to return the number of the month
etc .. .. there are plenty of others.
Any you're not sure off, or think you need - just post back and ask.


'ope-that-'elps.



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top