I would like to add an audio sound file to play when a particular button on a form is pressed.
Is there some code to add to the button that already has code to open a particular form?
If so...
Where do i place the "sound code" ?
Please be descriptive as I am not very programmer savy.
I am using Access 97...
Thanks...
csegal@arrowair.com
FancyPrairie (Programmer)gave this to me but it is all greek to me.
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Function PlaySound(FileName As String)
Dim MyReturn As Long
MyReturn = sndPlaySound(FileName, 1)
If (MyReturn <> 1) Then GoTo ErrHandler
'********************
'* Exit Procedure *
'********************
ExitProcedure:
Exit Function
'****************************
'* Error Recovery Section *
'****************************
ErrHandler:
Msgbox "Error from sndPlaySound" & vbCrLf & "Value is " & MyReturn, vbExclamation
GoTo ExitProcedure
End Function
Is there some code to add to the button that already has code to open a particular form?
If so...
Where do i place the "sound code" ?
Please be descriptive as I am not very programmer savy.
I am using Access 97...
Thanks...
csegal@arrowair.com
FancyPrairie (Programmer)gave this to me but it is all greek to me.
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Function PlaySound(FileName As String)
Dim MyReturn As Long
MyReturn = sndPlaySound(FileName, 1)
If (MyReturn <> 1) Then GoTo ErrHandler
'********************
'* Exit Procedure *
'********************
ExitProcedure:
Exit Function
'****************************
'* Error Recovery Section *
'****************************
ErrHandler:
Msgbox "Error from sndPlaySound" & vbCrLf & "Value is " & MyReturn, vbExclamation
GoTo ExitProcedure
End Function