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.
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.