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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
manojaminCommented:
it's not KeyDown event,

it should be KeyPress event,

and make KeyAscii = 0

that should work...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.