+ Reply to Thread
Results 1 to 2 of 2

User Form in VB = TextBox

  1. #1
    Kel
    Guest

    User Form in VB = TextBox

    Hi again

    I crated a User Form in VB and added a TextBox and i want the user to be
    able to enter 'Numbers only' not characters can anyone provide info please,
    if the user is trying to input other then numbers give no respond.

    thnx in advance

  2. #2
    Dave Peterson
    Guest

    Re: User Form in VB = TextBox

    Something like:

    Option Explicit
    Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

    Select Case KeyAscii
    Case Asc("0") To Asc("9")
    'do nothing
    Case Else
    Beep
    KeyAscii = 0
    End Select

    End Sub



    Kel wrote:
    >
    > Hi again
    >
    > I crated a User Form in VB and added a TextBox and i want the user to be
    > able to enter 'Numbers only' not characters can anyone provide info please,
    > if the user is trying to input other then numbers give no respond.
    >
    > thnx in advance


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1