Solved

wav file for Msgbox

Posted on 2003-11-09
1
247 Views
Last Modified: 2012-06-27
I have a field indexed not to allow duplicates.  I would like to prompt a MsgBox to call a wav file instead of the generic message given by MS Access.  Could someone help me with this?

Thanks,

IPT
0
Comment
Question by:iptrader
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 9712943
This code will allow you play any .wav sound through code .

However, if all you want to do is change the standard sounds for Question, Exclamation etc you can do this through Control Panel/Settings in the Sounds option.

Pete

This must go at the top of a module in the genral declarations section:
                                             
       Declare Function apisndPlaySound Lib "winmm" Alias _
       "sndPlaySoundA" (ByVal filename As String, ByVal snd_async _
       As Long) As Long

    '================================================================
    ' The following function PlaySound calls the Windows API function; call it from anywhere
    'Usage  PlaySound("C:\path to file.wav")
     ' example  ?playsound("D:\winnt\media\tada.wav")

 
      Function PlaySound(msound)
         Dim XX%
         XX% = apisndPlaySound(msound, 1) ' play mmwave sound
         If XX% = 0 Then MsgBox "The Sound Did Not Play!"
      End Function
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question