Mute sounds in my Database (1 Viewer)

Sean75db

Registered User.
Local time
Today, 03:27
Joined
May 16, 2014
Messages
33
Hello,

So i am building a DB for my work and i am having alot of fun with it today and showing my geek/nerd side and putting a few sounds to give it some flair, however i think it might be a good idea if the users can mute the sounds. what i have is a module with my sounds and then call fuctions where i want it to play, i have looked around but can't seem to find a way to mute, i was hoping for a button i could put on my login form to mute the sounds. Thanks for any help, below is the module code i use.


Option Compare Database
'*****************************************************************
'Declarations section of the module.
'*****************************************************************

Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal Filename As String, ByVal snd_async As Long) As Long
Public Function playwavefile(sWavFile As String)
'Purpose: Plays a sound.
'Argument: the fu11 path and file name.
If apisndPlaySound(sWavFile, 1) = 0 Then
MsgBox "The Sound Did Not Play!"
End If
End Function
'On Open of Navigation From
Public Sub PlayWaveFile_Cord()
Call playwavefile("G:\CLO Shared\CAL_DB\CAL Sounds\Goodmorning.wav")
End Sub
 

spikepl

Eledittingent Beliped
Local time
Today, 10:27
Joined
Nov 3, 2010
Messages
6,144
I have a perfect mute button for you - just enable the code when you run it :D
 

Attachments

  • Database1.accdb
    356 KB · Views: 386

Sean75db

Registered User.
Local time
Today, 03:27
Joined
May 16, 2014
Messages
33
That is cute!..... sadly i will use it to mess with people, but still need a mute button
 

spikepl

Eledittingent Beliped
Local time
Today, 10:27
Joined
Nov 3, 2010
Messages
6,144
Code:
Public Sub PlayWaveFile_Cord()
   if not forms!mymainform!mymutecheckbox then 'i.e. my  checkbox is NOT checked
           Call playwavefile("G:\CLO Shared\CAL_DB\CAL Sounds\Goodmorning.wav")
    end if
End Sub
 

Sean75db

Registered User.
Local time
Today, 03:27
Joined
May 16, 2014
Messages
33
Spike it works perfectly! thanks and thanks for the good joke i look forward to using that as well
 

Users who are viewing this thread

Top Bottom