
Req help with how to play a .wav sound in Access
Hi,
I'm running MS Access 97 and I'm trying to play .wav files from within Access.
Using the MS Knowledge base article Q95647, I created a module containing the following code:
Option Compare Database
Option Explicit
Declare Function sndPlaySound% Lib "mmsystem" (ByVal filename$, ByVal snd_async%)
' The declare function is actually all on one line
Function PlaySound(msound)
Dim XX%
XX% = sndPlaySound(msound, 1) 'play mwav sound
If XX% = 0 Then MsgBox "The Sound Did Not Play!"
End Function
I then created a command button on a form which has the onClick property set to:
=PlaySound("c:\windows\media\tada.wav")
When I click the button, I get an error message that says:
"The expression you entered has a function name that Microsoft Access can't find."
What am I doing wrong?
Thanks for your help!
Dean