Hello All,
In my Switchboard, I have a text box that I change the contents every once in a while. Usually a line or two as a "joke of the day" or maybe some witty saying. Now I thought I would change it to display the username and display that in the box as well as getting a little message based on the time of the day. The part I haven't tested yet is this;
' Get a Message based on the Time of Day
Dim MyTime As Integer
Dim MyHour As Integer
Dim MyMsg As String
'
MyTime = Time
MyHour = Hour(MyTime)
If MyHour <= 5 Then
MyMsg = "WOW! What are you doing here?"
ElseIf MyHour >= 6 And MyHour <= 7 Then
MyMsg = "You are here early today."
ElseIf MyHour >= 7 And MyHour <= 11
MyMsg = "Good Morning!"
ElseIf MyHour >= 12 And MyHour <= 16 Then
MyMsg = "Good Afternoon."
ElseIf MyHour >= 16 And MyHour <= 18 Then
MyMsg = "Are you staying late?"
ElseIf MyHour >= 19 And MyHour <= 21 Then
MyMsg = "Do you know what time it is?"
ElseIf MyHour >= 22 And MyHour <= 24
MyMsg = "You are a night crawler!"
Else
MyMsg = "You really are staying late!"
End If
As I don't want to set my clock to test each of these times to see if it works, does the logic with the If/ElseIf/Then flow look correct that it should work for those odd hours of before I get into work, and the times I am already home.
The flow looks correct, but I don't remember if I have worked to much with the If/ElseIf in a while.
Thanks for any feedback.
Tim