Just a dumb question. If I have an error, how can I play a sound on the sound card, to signify and error had been made.
Thanks in advance,
Andrew
Printable View
Just a dumb question. If I have an error, how can I play a sound on the sound card, to signify and error had been made.
Thanks in advance,
Andrew
Code:Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule _
As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
On Error GoTo Err
Error 1 'generate error
Exit Sub
Err:
PlaySound "MyWav.wav", 0&, &H1
MsgBox "Error!", vbCritical
End Sub