View Full Version : Count Down


Garyj
11-12-2003, 08:07 AM
How do I get a count down to appear each time my db opens? The message would be "You have 100 days left until the end of the year" This message would appear and day would be less each day. Any help would be appreciated

Thanks in advance

Mile-O
11-12-2003, 08:11 AM
This is the code for a message box:

Where exactly do you want the message to appear? On a form? A message box?

MsgBox "You have " & DateDiff("d", Date(), DateSerial(Year(Date()), 12, 31)) & " days left until the end of the year."

Garyj
11-12-2003, 08:25 AM
On a Form

Mile-O
11-12-2003, 08:36 AM
Put a label on your form. Call it lblDayInfo

On your form's Load event, put this code:

Private Sub Form_Load()
Me.lblDayInfo.Caption = "You have " & DateDiff("d", Date(), DateSerial(Year(Date()), 12, 31)) & " days left until the end of the year."
End Sub

Garyj
11-12-2003, 09:33 AM
Thanks that is exactly what I need.

Just one more thing can another message popup when the days reach 0? If that is not to much trouble. If not this is great.

Thanks allot

Garyj
11-12-2003, 11:44 AM
I just notice that the count down includes weedends. How get the same results without the weekends.

Thanks