Solved

wav file for Msgbox

Posted on 2003-11-09
1
238 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
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now