Button

hmongie

Registered User.
Local time
Today, 02:52
Joined
May 17, 2003
Messages
99
Does anyone know how to create a button that onclick, it will play a music file? If you do, please let me know how to do it. Thanx.
 
No help from there. I don't understand what they are talking about. Any help would be appreciated.
 
I am assuming that you did not search this site for the common keywords "sound" or
"music" or "wave files", etc? If you had then you would have found quite a few posts
on how to do it. Here is a suggestion that I have posted before on how to play a wave file...
Code:
Option Compare Database
Option Explicit
  
'PlayWaveFile
Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal filename As String, ByVal snd_async As Long) As Long
    
Public Function PlayWaveFile(sWavFile As String)
    
    If apisndPlaySound(sWavFile, 1) = 0 Then
        'MsgBox "The Sound Did Not Play!"
    End If
    
End Function
    
Public Sub PlayWaveFile_Cord()
    
    Call PlayWaveFile("C:\Windows\Media\chord.wav")
    
End Sub
HTH
 

Users who are viewing this thread

Back
Top Bottom