DoCmd.Beep is silent

Posted on 2004-11-02
Last Modified: 2008-02-01
Ok, don't all computers have a little internal speaker to squalk out beeps (even when there is no sound card)?
What command do I use to get my computer to squalk when a user does something stupid?

DoCmd.ThatWasReallyDumb isn't working either!

Question by:DavidWare
    LVL 44

    Expert Comment

    Click Start, Control Panel,Sound and Audio Devices, Volume Tab and make sure mute is not selected.  Alternatively click on the Speaker in the  Task bar/tray and make sure the speaker is on.
    LVL 20

    Expert Comment

    You can try to imbed the beep character in your message (like in a MsgBox command):

    MsgBox "There are several beeps " & Chr(7) & Chr(7) & Chr(7) & Chr(7) & Chr(7) & Chr(7) & Chr(7) & Chr(7)

    However, most times VBA will print a small box character  instead of passing through that ascii value.
    LVL 34

    Accepted Solution

    try the API to use the PC Speaker

    Public Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

    Use it like,
    Beep 800, 100

    Author Comment

    Sorry, I lost track of this one.

    The Control Panel in my Win2K operating system has "Sound and Multimedia", so I opened that and I don't see a "Volume" tab (there is "Sounds", "Audio", and "Hardware" and nowhere is there a "Mute" (except in the "Volume Control" when I double-click the Speaker in the systray, and none are muted.)
    On the "Sounds" tab, I scroll through the different sounds (like "Default Beep", which is listed as "ding.wav", but I don't think I'm barking up the right tree, because those use audio files that would go through the sound card and the speakers, and this system makes absolutely no sound at all (and I'm trying to write this ap for systems that don't necessarily have any speakers).  I'm looking for something more system-level that would use the motherboard speaker.
    I think that you're on the right track, though because of the very fact that this system makes absolutely no sound at all.  Next time I turn it off, I'll open the case and look at the motherboard.  Maybe there IS NO squalker.

    dsacker, I have coded in DoCmd.Beep and nothing happens - wouldn't that be (basicly) the same?

    I have added the API call as you recommend.  I'll see where that leads.

    Thanks for everyone's input and I'll get back here again soon.


    Author Comment

    The API worked!
    Thanks to all.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    745 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

    15 Experts available now in Live!

    Get 1:1 Help Now