Calling a Module

  • Thread starter Thread starter MartinTudge
  • Start date Start date
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
 
Call PlayIntro

or

Call PlaySound

as appropriate for what you want to do.

HTH
Van T. Dinh
MVP (Access)
 
Back
Top