Verify Data

Results 1 to 2 of 2

Thread: Verify Data

  1. #1
    Alex T. Guest

    Default Verify Data

    Sorry...I posted this a few weeks agao, but I don&#039;t think anyone saw it.<BR><BR>I am using an adaptation of some code on 4 Guys that will verify that a username contains only letters, numbers, hypens, and underscores. However, I can&#039;t seem to get it to work. It pops up the error message even if I have permissable data in the field. Here is my code: <BR><BR>Dim iStrPos, iLoop, strCurrentChar, bolValidString, ErrorMsg <BR>For iLoop = 1 to Len(Username) <BR>strCurrentChar = Mid(Username, iLoop, 1) <BR>If strCurrentChar = "_" _ <BR>or strCurrentChar = "-" _ <BR>or isNumeric(strCurrentChar) _ <BR>or (Asc(UCase(strCurrentChar)) &#062;= Asc("A") and _ <BR>Asc(UCase(strCurrentChar)) &#060;= Asc("Z")) _ <BR>Then <BR>Else <BR>bolValidString = False <BR>End If <BR><BR>Next <BR><BR>If Not bolValidString Then <BR>ErrorMsg = ErrorMsg & "Invalid Username" <BR>End If <BR><BR>P.S. The article link is here: <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Verify Data

    An uninitialized boolean is false. Just before your For loop initialize bolValidString to true. <BR><BR>(ie):<BR><BR>bolValidString=true

Posting Permissions

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