Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping the beep sound

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
how do I stop the Beep sound when using the below code..
I've tryed this a few different ways..

If KeyAscii = vbEnter Then
KeyAscii = 0
SendKeys "{tab}"
End If

only get the beep when in text boxes..

Thanks
 
I'm not sure, but have you tried switching the order? Brad,
Hey! email me any time! Bradsvb@yahoo.com
 
are you using vbEnter as the Enter key on the keyboard? if so, replace vbEnter with 13. vbEnter is a dragoverconstant that is equal to 0.
 
I tryed several ways.. The only way i got it to work was to place this in the key press

If KeyAscii = 13 Then
KeyAscii = 0
End If

then call my sub

now it works..

if i place the above code in my sub, it wont work for some reason..

Thanks
 
Pressing <Enter> while a textbox has focus causes the Beep / error if it’s multi line property is set to false. Change the multi line property of the text box to true. Keep in mind that your text box will now accept multiple lines of text.
 
it looks like he wanted the Enter key to simulate the Tab key, he was using vbEnter instead on vbKeyReturn, correct me if I'm wrong dvannoy.

Rob
 

Your right rdavis, dvannoy it should be vbKeyReturn and I seem to remember a previous thread from a month or so ago that was about the same thing. You might want to search for it (beep sound).

Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top