Answer: It is possible to play wav files within your Access database without using the API. We'll demonstrate how to do this on a button's on_click event. First you will need to create a new Module and paste in the following VBA
code:
Sub PlayWavFile(pFileName As String)
'Play wav file
FollowHyperlink Address:=pFileName
End Sub
Your module should look like this:
You can now make a call to this function with your wav file name as follows:
Private Sub Command1_Click()The code above would play the wav file called chimes.wav that is located in the c:\windows\media directory. You can choose when to play the wav file (ie: when a form opens, when a button is clicked, etc)
PlayWavFile "c:\windows\media\chimes.wav"
End Sub
No comments:
Post a Comment