Ding Problem

Hi,

This may sound funny but I need to get rid of an unwanted 'ding.'  I have a text box that is (and must be) set for Multiline off.  While using the textbox the user may press the enter key.  This is used to capture info in the box and initiate another process.

The problem appears to be that since the Multiline is off Windows issues a default error beep because there is no line to drop down to in the text box.  Turning Multiline on eliminates the beep but prevents another process from working properly.

Is it possible to turn off this annoying Windows warning beep and if so how?

Thanks!
syntelAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
manojaminConnect With a Mentor Commented:
it's not KeyDown event,

it should be KeyPress event,

and make KeyAscii = 0

that should work...
0
 
VbmasterCommented:
Add the code 'If (KeyCode = vbKeyReturn) Then KeyCode = 0' to the KeyDown event.
0
 
manojaminCommented:
Or if you just get rid of the ding without writing the code in every text box you have...

1) Control Panel | Devices
2) Look for "Beep" device
3) Stop the damn device
4) Click "Startup"
5) Select "Disabled" as Startup Type and click OK

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
KDivadCommented:
Or if you don't want code in every text box AND don't want to mess with a user's control panel settings. Set your form's KeyPreview property to true. And in the form's keydown event, check to see two things: 1. what control has the focus and 2. if the key was the enter key. If the key was the enter key and your one line text box is the control with the focus, then set KeyCode to 0.
0
 
VbmasterCommented:
In every textbox? hmm, doesn't the line "I have _a_ text box that is (and must be) set for Multiline off." mean only one textbox? ;)
0
 
manojaminCommented:
Yep! Vbmaster, you are right! It's a technicality here.
0
 
syntelAuthor Commented:
Tried adding 'If (KeyCode = vbKeyReturn) Then KeyCode = 0' to the KeyDown event but no luck so far.  I'd prefer to not change Window settings. I'm still working on it...thanks!
0
 
syntelAuthor Commented:
That did it.  Thanks to all.
0
 
syntelAuthor Commented:
Tried adding 'If (KeyCode = vbKeyReturn) Then KeyCode = 0' to the KeyDown event but no luck so far.  I'd prefer to not change Window settings. I'm still working on it...thanks!
0
 
KDivadCommented:
It still doesn't work? Try adding "If KeyCode = vbKeyReturn Then KeyCode = 0" to both the KeyUp and KeyDown events and "If KeyAscii = 13 Then KeyAscii = 0" to the KeyPress event.
(I put 13 because I don't remember for sure what the correct constant is and I KNOW 13 is the correct value.)
0
 
manojaminCommented:
It's been solved... I think the last comment was just Refresh Browser error!!!
0
 
KDivadCommented:
Not my browser. I checked the date and time that are displayed in the posts and the one I responded to is shown to be 13.5 hrs AFTER the one that says it was fixed. Maybe an EE problem, but I figured it wouldn't hurt to go ahead and respond.
0
 
manojaminCommented:
NOT YOURS!
see the comments dated
From: syntel
 Date: Wednesday, December 01 1999 - 01:16PM PST  

and

From: syntel
 Date: Wednesday, December 01 1999 - 01:16PM PST  

they are identical!
0
 
manojaminCommented:
sorry the second one is

 From: syntel
 Date: Thursday, December 02 1999 - 06:42AM PST  

also see the comment above

From: syntel
 Date: Wednesday, December 01 1999 - 01:16PM PST  

"That did it.  Thanks to all."
0
 
KDivadCommented:
I did see it. Often though, an answer is accepted and then turns out to be not quite right so another followup is asked for (I've done it before and had it done to questions that I answered). This is what I thought might have happened. I guess we won't know for sure until syntel reads these latest posts and tells us.
0
 
syntelAuthor Commented:
Sorry for the confusion.  I don't know where that other post came from.  The last post I intended to make was the 'Thanks to all' one.  I think it happened when someone in the office was on my PC after I left.  Again thanks to all for your answers!

0
 
KDivadCommented:
No problem. I promise to ignore further posts requesting help on this particular subject. ;-)
0
All Courses

From novice to tech pro — start learning today.