vb, autoevents and ppt - date corrected

  • Thread starter Thread starter Fred Dagg
  • Start date Start date
F

Fred Dagg

It's still my countdown clock but it relates to the VB code and/or the
autoevents addin. I actually had it running and tested it with changing the
system date and all was well but now it doesn't work so well. The date in
TxtDate changes but the LblBody doesn't react to the date change. I've tried
it with If, Then, Else and Case with the same effect. can someone check this
code and let me know if it the code or just a glitch with the autoevents
addin. Thanks.

Option Explicit

Sub Auto_ShowBegin()
If Date < "30/06/06" Then
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of 1st July 2006, blahblahblah."
Slide2.Label3.Caption = "There are Only"
Slide2.TxtCount.Text = DateDiff("d", Date, "1/07/06")
Slide2.Label4.Caption = "Days Left"
Else
If Date = "30/06/06" Then
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of TOMORROW, blahblahblah."
Slide2.Label3.Caption = ""
Slide2.TxtCount.Text = ""
Slide2.Label4.Caption = ""
Else
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of NOW, blahblahblah"
Slide2.Label3.Caption = ""
Slide2.TxtCount.Text = ""
Slide2.Label4.Caption = ""
End If
End If
End Sub

Sub Auto_NextSlide()
[ Exactly the same as above, copied to here ]
End Sub

Actually, when the system date is 30/06/06, LblBody works as per the Else
part, not the date = part.
Help please?
 
Personally, I would change two things. One, make a select statement.
Second, change to a date format.

Sub Auto_ShowBegin()
Select Case Date
Case Is < #6/6/2006#
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of 1st July 2006, blahblahblah."
Slide2.Label3.Caption = "There are Only"
Slide2.TxtCount.Text = DateDiff("d", Date, "1/07/06")
Slide2.Label4.Caption = "Days Left"

Case Is = #6/6/2006#
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of TOMORROW, blahblahblah."
Slide2.Label3.Caption = ""
Slide2.TxtCount.Text = ""
Slide2.Label4.Caption = ""

Case Else
Slide2.TxtDate.Text = Format(Date, "Long Date")
Slide2.LblBody.Caption = "As of NOW, blahblahblah"
Slide2.Label3.Caption = ""
Slide2.TxtCount.Text = ""
Slide2.Label4.Caption = ""
End Select

End Sub


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Back
Top