I am new to access and just learning some basic skills. I would like to be able to say good morning or good afternoon based on the time of day. I think it can be done but don't know where to start. Please help.
I am new to access and just learning some basic skills. I would like to be able to say good morning or good afternoon based on the time of day. I think it can be done but don't know where to start. Please help.
Not something I would have thought of but look at the Time() function:
https://www.techonthenet.com/access/.../date/time.php
https://www.msofficeforums.com/word-...ased-time.html
Now do you get the report to "say" that is up to you, a message box in the Open event of the report, a textbox on the report itself...
Cheers,
Taking what you say literally . . .I would like to be able to say good morning or good afternoon based on the time of day.
from Mike Wolfe:
Combine it with Vlad'sCode:Sub Speak(Msg As String, Optional Gender As String = "Male") Dim Vox As Object ' SpeechLib.SpVoice Set Vox = CreateObject("SAPI.SpVoice") ' New SpeechLib.SpVoice Set Vox.Voice = Vox.GetVoices("Gender = " & Gender).Item(0) Vox.Speak Msg End Sub
Code:Sub Greeting() Select Case Time Case Is < TimeValue("12:00") Speak "Good morning" Case Is < TimeValue("16:00") Speak "Good afternoon" Case Else Speak "Good evening" End Select End sub
If this helped, please click the star * at the bottom left and add to my reputation- Thanks