+ Reply to Thread
Results 1 to 4 of 4

Validation Of Textboxes In A Form

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2007
    Posts
    7
    Thanks mudraker, that codes works great.
    Could you show me the code that would validate TextBox1 (Item name) so that something written in there is less than 50 characters but more than 0. Thanks a lot, a quick reply would be much appreciated.

    Thanks, Ben.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Ben

    If you use the MaxLength property set to 50 then you cane use

    If TextBox.Text = vbNullString Then
       MsgBox "Invalid Entry", vbInformation
       Exit Sub
    end if
    Otherwise use this one

    Select Case Len(TextBox.Text)
    Case Is < 1, Is >= 50
       MsgBox "Invalid Entry", vbInformation
       Exit Sub
    End Select

+ 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