D
Douglas J. Steele
You could create a function along the lines of:
Function SelectGreeting() As String
If Time() >= #7:00:00# And Time() <= #12:00:00# Then
SelectGreeting = "Good Morning"
ElseIf Time() > #12:00:00# And Time() <= #18:00:00# Then
SelectGreeting = "Good Afternoon"
ElseIf Time() > #18:00:00# And Time() <= #23:59:59# Then
SelectGreeting = "Good Evening"
Else
SelectGreeting = "Go to bed!"
End If
End Function
and then simply call that function.
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
between 7:00 am and 12:00pm, etc. Is this really all I have to do? I know
that I can do Between dates in a query, but I'm just a bit unsure of putting
them as conditions in a macro. Should this be any different?
Function SelectGreeting() As String
If Time() >= #7:00:00# And Time() <= #12:00:00# Then
SelectGreeting = "Good Morning"
ElseIf Time() > #12:00:00# And Time() <= #18:00:00# Then
SelectGreeting = "Good Afternoon"
ElseIf Time() > #18:00:00# And Time() <= #23:59:59# Then
SelectGreeting = "Good Evening"
Else
SelectGreeting = "Go to bed!"
End If
End Function
and then simply call that function.
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
generic "Hello" greeting, I'd like to have:Derek Wittman said:Good afternoon,
I would like to customize my macro-sent emails a bit. Instead of the
wouldn't care if I had to make 3 actions with conditions of Time() isGood morning,
Good afternoon,
and even Good evening,
based on the time of day that I execute the macro in question. I really
between 7:00 am and 12:00pm, etc. Is this really all I have to do? I know
that I can do Between dates in a query, but I'm just a bit unsure of putting
them as conditions in a macro. Should this be any different?