DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Alphanumeric issues

    I am taking a shot here because i am frustrated. I am sure this will sound basic to many of you but I am struggling with validation errors on my customer information form. Although I can check whether it is alpabetic or numeric it only checks the first character. If I enter "R3" for example it allows it. I know that I need to run a for next loop to check the whole string but I am not having any luck writing the code for it. Any help would be immensely appreciated. I found some code in this forum but don't know how to apply it to my project for class.
    Here is what I found:
    Code:
    Public Function checkAlphaNumeric(strInputText As String) _
                                     As Boolean
    Dim intCounter As Integer
    Dim strCompare As String
    Dim strInput As String
    checkAlphaNumeric = False
    For intCounter = 1 To Len(strInputText)
        strCompare = Mid$(strInputText, intCounter, 1)
        strInput = Mid$(strInputText, intCounter + 1, Len _ (strInputText))
        If strCompare Like ("[A-Z]") Or _
            strCompare Like ("[a-z]") Or _
            strCompare Like ("#") Then
            checkAlphaNumeric = True
        Else
            checkAlphaNumeric = False
            Exit Function
        End If
     Next intCounter
    End Function
    my two fields are txtName.Text and txtCity.Text thank you for a little hand holding.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,652
    Welcome to DevX

    What are you trying to disallow? Alpha or numeric?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Looking for a Javascript pro to help work out web application issues
    By Freelancer.Internet.com in forum Careers
    Replies: 0
    Last Post: 08-25-2009, 09:10 PM
  2. Axis 2.1.3 - WSDL2Java Client stub issues
    By dilip.kumar in forum Web
    Replies: 2
    Last Post: 06-18-2008, 04:41 AM
  3. dealing with employee moral issues
    By ubuntulover6 in forum .NET
    Replies: 1
    Last Post: 10-28-2007, 07:28 AM
  4. Replies: 3
    Last Post: 04-08-2005, 05:49 AM
  5. Oracle and Ado Issues
    By Ian Hossie in forum VB Classic
    Replies: 1
    Last Post: 12-11-2001, 08:38 AM

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links