Pop Up Error Msg box sounds

mkdrep

Registered User.
Local time
Today, 11:59
Joined
Feb 6, 2014
Messages
181
I searched the forum for this topic to no avail....would appreciate it if someone could show me how to get a "sound" to occur everytime a certain message box pops up.

I wrote the following code which currently allows the MsgBox to open when the criteria is met, BUT it does not make a sound when opening. I followed the instructions as per this link (which I found when I googled the question) http://blogs.technet.com/b/heyscrip...und-each-time-a-message-box-is-displayed.aspx



Private Sub Open_frmAccessories_Click()
If (Me!txtProductGroup) = 9 Then
MsgBox "This Product Does Not Have Any Accessories", -vbExclamation, "NO Accessories for this Product"
Exit Sub
Else

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAccess"

stLinkCriteria = "[AccessGrp]=" & "'" & Me![AccessGrp] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_frmAccessories_Cli:
End If
End Sub

I have attached a copy of the pop up box to show it is working correctly, albeit without the sound function. Curiously, if I click on any button in the Products main screen behind the Error Msg box, i.e. "New" or "Close" the SOUND occurs at that point!

Thank you in advance for your suggestions.
 

Attachments

  • Error-Msg-Sound-Code.jpg
    Error-Msg-Sound-Code.jpg
    48.2 KB · Views: 100
  • Error-Msg-PopUp.jpg
    Error-Msg-PopUp.jpg
    86.5 KB · Views: 70
Do you really really want to do this? Share the joy of listening to other people's WIndows sounds at the office? Really?
 
Do you really really want to do this? Share the joy of listening to other people's WIndows sounds at the office? Really?

Yes I do! :-)
 

Users who are viewing this thread

Back
Top Bottom