TheGeneral
New member
- Local time
- Today, 16:22
- Joined
- Aug 26, 2011
- Messages
- 8
Hi Everyone,
totaly new to forums so forgive me if i have foregone any relevant courtesies!
I am building a database and have decided to add a Modal pop-up welcome message which i hoped would say good morning/afternoon/evening depending on the relevant time of day.
I have added 3 lables;
LblMorning
LblAfternoon
LblEvening
each with the relevant caption;
Good Morning
Good Afternoon
Good Evening.
The labels are set to Not visible so the code i have added will set the relevant label to visible.
I have applied code to the "On Activation" event as follows;
Private Sub Form_Activate()
If Time() < 0.5 Then
[LblMorning].Visible = True
[LblAfternoon].Visible = False
[LblEvening].Visible = False
ElseIf Time() > 0.5 And Time() < 0.75 Then
[LblMorning].Visible = False
[LblAfternoon].Visible = True
[LblEvening].Visible = False
ElseIf LblClock > 0.75 Then
[LblMorning].Visible = False
[LblAfternoon].Visible = False
[LblEvening].Visible = True
End If
End Sub
However this is not working and i cant see the issue in the code. at present when this modal opens it doesnt display any of my labels.
Would really appreciate any help anyone can give on this!
Thanks everyone!
totaly new to forums so forgive me if i have foregone any relevant courtesies!
I am building a database and have decided to add a Modal pop-up welcome message which i hoped would say good morning/afternoon/evening depending on the relevant time of day.
I have added 3 lables;
LblMorning
LblAfternoon
LblEvening
each with the relevant caption;
Good Morning
Good Afternoon
Good Evening.
The labels are set to Not visible so the code i have added will set the relevant label to visible.
I have applied code to the "On Activation" event as follows;
Private Sub Form_Activate()
If Time() < 0.5 Then
[LblMorning].Visible = True
[LblAfternoon].Visible = False
[LblEvening].Visible = False
ElseIf Time() > 0.5 And Time() < 0.75 Then
[LblMorning].Visible = False
[LblAfternoon].Visible = True
[LblEvening].Visible = False
ElseIf LblClock > 0.75 Then
[LblMorning].Visible = False
[LblAfternoon].Visible = False
[LblEvening].Visible = True
End If
End Sub
However this is not working and i cant see the issue in the code. at present when this modal opens it doesnt display any of my labels.
Would really appreciate any help anyone can give on this!
Thanks everyone!