vbQuestion and beep sounds

F

Fred Boer

I have created a yes/no messagebox which uses the constant "vbQuestion". I
am used to using "vbInformation", which provides a nice tinkling sound. It
appears vbQuestion doesn't automatically generate a sound. Now... I can
stick in a "docmd.beep", but it makes this ugly "blooping" kind of sound...

1. Why do you think vbQuestion doesn't produce a sound and vbInformation
does?
2. Assuming I *don't* want to mess with my standard Windows sound settings,
is there a way to change the sound used by ".beep"?
3. And, just out of curiosity, what if you *didn't* want vbInformation to
make a sound?

Cheers!
Fred Boer
 
D

Danny J. Lesandrini

Try changing this setting from windows. Go to Control Panel and
click on Sounds. Look around in there for where you assign sounds
to certain "windows" events.
 
F

Fred Boer

Thanks, but I believe this will change the sounds only on the current
machine, and, also, I don't want to mess with the default windows sound
scheme..

Fred
 
D

Danny J. Lesandrini

Yea, I understand that, but what I'm getting at is that the sound
you are hearing for the one event is programmed in windows ... not
in VB. If you force a critical stop in your code, it fires the windows
critical stop event, which launches the assigned sound.

I could be wrong about this, but I think that's what's happening here.
 
F

Fred Boer

Oh, I see what you mean; sorry to have misunderstood you! Thanks for your
explanation - I've learned something new...

BTW, I *think* I have a solution that works: I did some more searching and
found a "Playsound" function on Allen Browne's website, and I simply call
this function rather than ".beep".. Of course, the specific .wav file has to
be on every computer, but I can copy the file over when I install the
application...

Thanks again!
Fred
 
D

Dirk Goldgar

Fred Boer said:
I have created a yes/no messagebox which uses the constant
"vbQuestion". I am used to using "vbInformation", which provides a
nice tinkling sound. It appears vbQuestion doesn't automatically
generate a sound. Now... I can stick in a "docmd.beep", but it makes
this ugly "blooping" kind of sound...

1. Why do you think vbQuestion doesn't produce a sound and
vbInformation does?

It's controlled by the system sounds, settable in the Control Panel ->
Sounds applet.
2. Assuming I *don't* want to mess with my standard Windows sound
settings, is there a way to change the sound used by ".beep"?

No, but you can play any sound you want with an API call.
3. And, just out of curiosity, what if you *didn't* want
vbInformation to make a sound?

If you use the MsgBox function, you're out of luck -- it's going to play
the Windows system sound associated with the MsgBoxStyle option you
specify. You'd have to use your own message box form (or a message box
created entirely by API calls).
 
F

Fred Boer

Hi Dirk:
No, but you can play any sound you want with an API call.

With something like Dev Ashish's "Play Wav/MIDI/Avi/ files" at
http://www.mvps.org/access/api/api0011.htm , right?

And, yes, I *should* have found this myself, but I wasn't thinking along the
right lines... I was thinking it had to be something internal to Access, and
the idea of playing an external wav file didn't occur to me until after
posting...

Cheers!
Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top