Pop Up Error Msg box sounds

samedi 28 février 2015

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://ift.tt/1DDCaNy







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.




Attached Images









File Type: jpg Error-Msg-Sound-Code.jpg (48.2 KB)
File Type: jpg Error-Msg-PopUp.jpg (86.5 KB)



Pop Up Error Msg box sounds

0 commentaires:

Enregistrer un commentaire

Labels