Req help with how to play a .wav sound in Access 
Author Message
 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



Sun, 28 Jan 2001 03:00:00 GMT  
 Req help with how to play a .wav sound in Access
Try the code (API section) at my website and call it as

=fPlayStuff("C:\Win95\intro.wav")

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

: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



Sun, 28 Jan 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Playing sounds even if other applications are playing sounds

2. Play WAV sound on event??

3. Playing sound (wav) in vb.net

4. Play WAV sounds in VB.NET

5. Detecting sound card for playing WAV files

6. Dial a phone and play wav sound?

7. Playing a WAV sound on a click event.

8. How do I play sounds (not .wav)?

9. Play sound without .wav..

10. Play sound without .wav..

11. How to play .WAV sounds?

12. How to play .WAV sounds from VB6?

 

 
Powered by phpBB® Forum Software