I'm making a program for a company, and I would like it to show a message box saying "Good Morning", or "Good Afternoon", depending on AM/PM.
I have a timer and a label working all fine and good with:
VB Code:
Private Sub TimerTime_Timer() LblClock.Caption = Format$(Time, "HH:MM:SS AMPM") End Sub
And then I created a message box on form load:
VB Code:
If LblClock.Caption = "**:**:** AM" Then MsgBox "Good Morning" Else MsgBox "Good Evening" End If
I'm not too good at Visual Basic, so I'm probably making a really stupid and obvious error, but what is wrong with that code? It doesn't show any message box.




Reply With Quote