Results 1 to 2 of 2

Thread: Catch/Stop input in textboxes

  1. #1
    Guest

    Post

    How do I stop a character(say a *) and a carriage return(pressing enter) from being entered into a textbox?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Trap it in the KeyPress Event, ie.
    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = Asc("*") Or KeyAscii = vbKeyReturn Then KeyAscii = 0
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert

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