-
Sastraxi:
I followed your module for the tick wave file to tick on the seconds (Can be found under "Anyone have questions out there?". I have come up with a problem!
When I click on the sound option button that has a message box come up and ask "Do you want the clock to tick?" - Yes / No response required. Under "tmrRealTime" event I had the response to the message box = 6 then call "Main" to start the tick sound. It worked but the time froze???
Then I thought about calling the "Main" function in the modTick in its own timer event "tmrTick" and make the interval = to that of the "tmrRealTime". If "Yes" is clicked it would tick on seconds but not aligned with "tmrRealTime". But yet another problem has arose, if I went back to click on the sound option button and "No" for the message box that prompts "Do you want the clock to tick?", it does not turn off the wave file.
I think I am close to tying this up but need a little help!
In Summary:
1.) When I click on the "Yes" from the message box that it turns on the "Tick" wave file. It is aligned with the seconds on the clock.
2.) When I click on the "No" from the message box that it turns off the "Tick" wave file
What do you think? I now this is a lengthy message but I wanted to give the most background.
-
Set the startup form to submain. Add this code to the start of Sub Main():
Code:
Option Explicit
...
Public Tick As String 'instead of Const Tick = "tick.wav"
Sub Main()
Dim A
Dim OldSecond As Long
Dim RetVal As Long
tick = "tick.wav"
RetVal = Msgbox("Would you like the clock to tick?", VbYesNo, "Clock Ticker")
If RetVal = VbYes Then
ElseIf RetVal = VbNo Then
tick = ""
End If
OldSecond = Second(Now)
Do
...
PlayWav Tick, SND_ASYNC AND SND_NODEFAULT
...
Loop
End Sub