I have a form that performs a requery every 5 seconds using the ontimer event. When a new record exists in my appointments table it populates on the form. What I want to do is get a sound to play after the me.requery function IF a new record exists.
"IF a new record exists then API_PlaySound "c:\windows\media\chimes.wav"
I have tested the sound module if I put the API_playsound function into the ONLOAD event, it works.
Option Compare Database
Const SND_ASYNC = (1)
Const SND_NODEFAULT = (2)
Declare Function sndplaysound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub API_PlaySound(pWavFile As String)
Dim LResult As Long
LResult = sndplaysound(pWavFile, SND_NODEFAULT + SND_ASYNC)
End Sub
"IF a new record exists then API_PlaySound "c:\windows\media\chimes.wav"
I have tested the sound module if I put the API_playsound function into the ONLOAD event, it works.
Option Compare Database
Const SND_ASYNC = (1)
Const SND_NODEFAULT = (2)
Declare Function sndplaysound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub API_PlaySound(pWavFile As String)
Dim LResult As Long
LResult = sndplaysound(pWavFile, SND_NODEFAULT + SND_ASYNC)
End Sub