Calling a Module

M

MartinTudge

Hi All
I have created a module called 'Soundthings' to play a
sound within Access.
Beliow is the procedures I have put into the module.
The only issue now is how do i call up the procedure
below to play the sound.

Hope someone can help.
Regards
Martin
________________________________________________
Option Compare Database
Option Explicit

Declare Function sndPlaySound Lib "Winmm.dll"
Alias "sndPlaySoundA" (ByVal lpszSoundName As String,
ByVal uFlags As Long) As Long
Public Const KEY_RETURN = &HD
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10

Public Sub PlaySound(pFile As String)

sndPlaySound pFile, SND_SYNC
End Sub

Public Sub PlayIntro()
Dim s As String
s = DBEngine(0)(0).Name
While Right$(s, 1) <> "\": s = Left$(s, Len(s) - 1): Wend
s = s & "SETUP0.WAV"

PlaySound s

End Sub
 
V

Van T. Dinh

Call PlayIntro

or

Call PlaySound

as appropriate for what you want to do.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Calling A Module 5
Assign a sound to a variable 19
PlaySound 1
Sound repeats unending until closing workbook 2
Wavfile playing trubcated 3
winmm.dll entry points ? 0
playing wma files 2
Problem plaing Wav on CE5 7

Top