Visual Basic:
Dim i As Integer
For i = 0 To UBound(userManagement.names)
If userManagement.names(i) = nameTf.Text Then
MessageBox.Show("Name already present in the database" )
Exit For
Else
nameDis = nameTf.Text
userManagement.AddUserPass(firstChar, nameDis)
Exit For
End If
Next
userManagement is just a module i made for the storing of values into array.
what i'm trying to do is:
If the user enters a name into the textbox, and the name is already in the array, then it will show the error message.
what the problem is:
For the first name i enter (eg. Jim). after i reenter the name again, it shows the error message.
But after the first name works, I tried to enter another name (eg. ZC). i can just add the value into the array again and again without showing the error message.
anyone can help?
Last edited by a moderator: