There is no built in sound function for Databases. You need to add it in.
Go to the Create tab, and select Module. This will open a programming window. Add the following code
Declare Function apisndPlaySound Lib “winmm” Alias “sndPlaySoundA” _
(ByVal filename As String, ByVal snd_async As Long) As Long
Function PlaySound(sWavFile As String)
‘ Purpose: Plays a sound.
‘ Argument: the full path and file name.
If apisndPlaySound(sWavFile, 1) = 0 Then
MsgBox “The Sound Did Not Play!”
End If
End Function
Save it as “Sounds” and close the window.
Go to the form the sound will play on, right click the object and choose Properties (or Form Properties if the sound is for the form itself).
Add the following bit of code, with the path to the correct file, to the appropriate property in the event tab.
=PlaySound(“C:WINDOWSMEDIACHIMES.WAV”)
For example, if the sound if to play when the Form is opened:
1. Right click and choose Form Properties
2. Add the code to the OnLoad property of the Event Tab