+ Reply to Thread
Results 1 to 2 of 2

TextBox Values

  1. #1
    Abdul
    Guest

    TextBox Values

    Hello!,

    How I can limit textbox (or combo) from accepting only numbers and
    Minimum is zero and maximum is Number of days in a specific month?

    say for eg. In comboBox1 i select february then textBox1 shoul accept
    only from 0 to 28 or in case of april 0 to 30, May 0 to 31 etc...

    based on the value in textbox1 textbox2 is calculated, so textbox1
    should not be allowed to be empty to avoid an error

    thanks


  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667

    TextBox Values

    The simplest way for beginners is to validate the data once it is entered.
    Private Sub TextBox1_Change()
    t = TextBox1.Text
    If Not IsNumeric(t) Then MsgBox "Non numeric character "
    End Sub

    For experts, each keystroke can be monitored.
    Best regards,

    Ray

+ 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