Re: Date Time Difference
From: RK (anonymous_at_discussions.microsoft.com)
Date: 04/08/04
- Next message: Prokofiev: "Re: Copying Records"
- Previous message: TC: "Re: Calculating a time"
- In reply to: Graham Mandeno: "Re: Date Time Difference"
- Next in thread: Graham Mandeno: "Re: Date Time Difference"
- Reply: Graham Mandeno: "Re: Date Time Difference"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Apr 2004 21:38:14 -0700
Created
Test Boxes - txtEndTime, txtCountDown
Created Funtion (below) modCountDown
In the forms timer interval = 120
?? Me.txtCountDown = CountDown(txtEndTime), doesn't
compile
What am I messing up?
Thanks
>-----Original Message-----
>Hi RK
>
>Probably the best method is to write a function to
calculate the difference
>in seconds and then format the string:
>
>Public Function CountDown(EndTime as Variant) as String
>Dim lTemp as long
>Dim D as Integer, H as Integer, M as Integer, S as
Integer
>If Not IsDate(EndTime) then Exit Function
>lTemp = DateDiff("s", Now, EndTime)
>S = lTemp Mod 60
>lTemp = lTemp \ 60
>M = lTemp Mod 60
>lTemp = lTemp \ 60
>H = lTemp Mod 24
>D = lTemp \ 24
>CountDown = D & " days, " & H & " hours, " _
> & M & " minutes, " & S & " seconds"
>End Function
>
>Now, all you need is a textbox or label on your form and
a Timer event which
>updates it every second:
>
>Me.txtCountDown = CountDown(txtEndTime)
>--
>Good Luck!
>
>Graham Mandeno [Access MVP]
>Auckland, New Zealand
>
>
>
>"RK" <anonymous@discussions.microsoft.com> wrote in
message
>news:1a04e01c41d17$f5d951d0$a101280a@phx.gbl...
>> How can I create a Count down clock on a form. ie put
in
>> an end date and time and based off the current time
would
>> display the number of days, hours, minutes to the end
>> date. I tried to experiment with an excel spread sheet
>> with some success but cand't get it to work in Access.
>> Any thoughts?
>>
>> Thank you.
>>
>>
>
>
>.
>
- Next message: Prokofiev: "Re: Copying Records"
- Previous message: TC: "Re: Calculating a time"
- In reply to: Graham Mandeno: "Re: Date Time Difference"
- Next in thread: Graham Mandeno: "Re: Date Time Difference"
- Reply: Graham Mandeno: "Re: Date Time Difference"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|