Results 1 to 4 of 4

Thread: no beep

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I have a textbox on my form, and if the user hits the enter key, the program executes some code, but it also beeps.
    How do I stop it from beeping?

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    If you are running some code on an enter key press, i am guessing that you are testing for the enter key. Once you know it is the enter key, set the KeyAscii / KeyCode = 0. That will stop it beeping.
    Iain, thats with an i by the way!

  3. #3
    Guest
    This will solve your problem:

    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            'your thing here
         
            KeyAscii = 0    
            'this resets KeyAscii, so its like no key was
            'pressed at all
         End If
    End Sub
    Sunny

  4. #4
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Or you can use a hidden default button with sendkeys code in the click event
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width