|
-
Jan 28th, 2000, 11:23 AM
#1
Thread Starter
New Member
hi..
i am a basic vb learner.. i have a problem about the email validation.. actually inside my program have atext box who let user to key in email.. but some of the invalid field like double "@" in a field or "@clouclck.com" and have alot of invalid field.. so. can somebody help me to fix this validation by showing me source code.. i will appreciate it.. thx.. hope hear from u soon..!
-
Jan 28th, 2000, 12:20 PM
#2
Fanatic Member
Hi cloudlck,
Here's some email validation code. I included everything I could think of that would need to be in an email address. However, you should easily be able to add more validation after checking out the code below.
In order to try it out, create a new project with a text box and a command button.
Code:
Option Explicit
Private Sub Command1_Click()
If Text1 = "" Or Left(Text1, 1) = "@" Or InStr(Text1, "@") = 0 Or UCase(Right(Text1, 3)) <> "COM" Or InStr(Text1, "@@") > 0 Then
MsgBox "Invalid Email Address.", vbCritical, "Try Again."
Text1.SetFocus
Else
MsgBox "Valid Email Address."
End If
End Sub
All the best.
------------------
OneSource
The truth may be out there, but it's in here too!
.
[This message has been edited by OneSource (edited 01-29-2000).]
-
Jan 28th, 2000, 12:45 PM
#3
Thread Starter
New Member
thanks one source... the code is work on my module.. thx.. nice to meet you..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|