A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do display a countdown timer



 
 
Thread Tools Display Modes
  #1  
Old March 10th, 2009, 03:32 PM posted to microsoft.public.access.tablesdbdesign
jagnval
external usenet poster
 
Posts: 2
Default How do display a countdown timer

I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer items
are open for bidding, any help will be greatly appreciated.
  #2  
Old March 10th, 2009, 05:42 PM posted to microsoft.public.access.tablesdbdesign
Steve[_57_]
external usenet poster
 
Posts: 598
Default How do display a countdown timer

In your auction item table you need a field for auction close date and time.
Then you can use the Now(0 function and that field in the DateDiff method to
express how much longer an item is open for bidding.

Steve




"jagnval" wrote in message
...
I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer
items
are open for bidding, any help will be greatly appreciated.



  #3  
Old March 11th, 2009, 12:53 AM posted to microsoft.public.access.tablesdbdesign
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default How do display a countdown timer

On Tue, 10 Mar 2009 08:32:17 -0700, jagnval
wrote:

I am assuming you already have a field in your Items table to record
the EndOfBidding date/time.
In your form (I am assuming bound to the Items table) create a new
label, say lblCountdown.
Set the form's TimerInterval to for example 5000 so the timer ticks
every 5 seconds.
In the Form_Timer event write:
Me.lblCountdown.Caption = datediff("s", Now, Me.EndOfBidding)

This would give you the number of seconds until EoB. Use the Format
function if you want to format this value differently.

-Tom.
Microsoft Access MVP



I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer items
are open for bidding, any help will be greatly appreciated.

  #4  
Old March 11th, 2009, 01:47 PM posted to microsoft.public.access.tablesdbdesign
jagnval
external usenet poster
 
Posts: 2
Default How do display a countdown timer

Tom,

First off thank you for your help. I have the run the DateDiff and I have
the seconds until the ending bid date on a timer interval of 1 second, but I
can't get it reformatted into the format I want of hh:mm:ss. may be even
days, I would like for it to be like a countdown clock when the seconds
start at 60 and countdown to 0 and that would take off 1 min and so on.

"Tom van Stiphout" wrote:

On Tue, 10 Mar 2009 08:32:17 -0700, jagnval
wrote:

I am assuming you already have a field in your Items table to record
the EndOfBidding date/time.
In your form (I am assuming bound to the Items table) create a new
label, say lblCountdown.
Set the form's TimerInterval to for example 5000 so the timer ticks
every 5 seconds.
In the Form_Timer event write:
Me.lblCountdown.Caption = datediff("s", Now, Me.EndOfBidding)

This would give you the number of seconds until EoB. Use the Format
function if you want to format this value differently.

-Tom.
Microsoft Access MVP



I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer items
are open for bidding, any help will be greatly appreciated.


  #5  
Old March 12th, 2009, 03:57 AM posted to microsoft.public.access.tablesdbdesign
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default How do display a countdown timer

On Wed, 11 Mar 2009 06:47:01 -0700, jagnval
wrote:

Do some simple math. First calculate the hours by doing an integer
division:
dim secs as long
secs = datediff(...)
dim h as integer
h = secs \ (60*60)

Get the remainder:
secs = secs - h * 60*60

Repeat this for minutes and seconds. Format as a string.

-Tom.
Microsoft Access MVP


Tom,

First off thank you for your help. I have the run the DateDiff and I have
the seconds until the ending bid date on a timer interval of 1 second, but I
can't get it reformatted into the format I want of hh:mm:ss. may be even
days, I would like for it to be like a countdown clock when the seconds
start at 60 and countdown to 0 and that would take off 1 min and so on.

"Tom van Stiphout" wrote:

On Tue, 10 Mar 2009 08:32:17 -0700, jagnval
wrote:

I am assuming you already have a field in your Items table to record
the EndOfBidding date/time.
In your form (I am assuming bound to the Items table) create a new
label, say lblCountdown.
Set the form's TimerInterval to for example 5000 so the timer ticks
every 5 seconds.
In the Form_Timer event write:
Me.lblCountdown.Caption = datediff("s", Now, Me.EndOfBidding)

This would give you the number of seconds until EoB. Use the Format
function if you want to format this value differently.

-Tom.
Microsoft Access MVP



I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer items
are open for bidding, any help will be greatly appreciated.


  #6  
Old March 13th, 2009, 05:15 AM posted to microsoft.public.access.tablesdbdesign
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default How do display a countdown timer

On Wed, 11 Mar 2009 06:47:01 -0700, jagnval
wrote:

The basic idea is that if you divide by 60*60 you get the number of
hours. Use the \ to get an integer division:
secs = datediff(...)
dim h as integer
h = secs\(60*60)

Then subtract those seconds from secs and you are left with the
remainder:
dim remainder as long
remainder = secs - (h*60*60)

Then do the same for minutes, etc.

-Tom.
Microsoft Access MVP


Tom,

First off thank you for your help. I have the run the DateDiff and I have
the seconds until the ending bid date on a timer interval of 1 second, but I
can't get it reformatted into the format I want of hh:mm:ss. may be even
days, I would like for it to be like a countdown clock when the seconds
start at 60 and countdown to 0 and that would take off 1 min and so on.

"Tom van Stiphout" wrote:

On Tue, 10 Mar 2009 08:32:17 -0700, jagnval
wrote:

I am assuming you already have a field in your Items table to record
the EndOfBidding date/time.
In your form (I am assuming bound to the Items table) create a new
label, say lblCountdown.
Set the form's TimerInterval to for example 5000 so the timer ticks
every 5 seconds.
In the Form_Timer event write:
Me.lblCountdown.Caption = datediff("s", Now, Me.EndOfBidding)

This would give you the number of seconds until EoB. Use the Format
function if you want to format this value differently.

-Tom.
Microsoft Access MVP



I am creating an auction database to help in the removal of unused items at
my work place and need to display a countdown timer of how much longer items
are open for bidding, any help will be greatly appreciated.


 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.