Great, those codes works the way that I want.
But it lead me to another question (I don't know if it's consider as new
question or not, i'm a newbie to this discussion).
In another discussion with my friend (who studied php),he said that PHP
had
a script to check an input from a user if it not contains character that
an
email address require, such as "@" character. The script is :
(!txtEmailAddress( "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$",
$emailhp)
the first part (before the plus (+) sign indicate the user name, and the
part after it indicate the web server name. If the second part doesn't
contains the "@" char, it would lead to another script that notify the
user
name to fix the email address he wrote.
The codes that Mr.Wayne-I-M, Mr.Steele, and Mr. Adams wrote helps me to
solve the first part and some of the second part.
Anyway...
With the same way that Mr. Wayne's codes, I could try some codes to solve
the "@" char, and I will write to this discussion soon after I find the
answer.
Or maybe anyone could help with this one.
Thanks
Cheers
Bobby
Wayne-I-M said:
following on from Douglas's suggestion, another idea would be to prevent
non
"e mail address" items such as " ' * > etc etc. Something like this
should
work.
Private Sub EmailAddress_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeySpace Or KeyAscii = Asc("'") Or KeyAscii = Asc(">") Or
KeyAscii = Asc("*") Then
KeyAscii = 0
End If
End Sub
You will need to address the items you want to exclude (I have put in a
few
to show you how it works
Good luck
--
Wayne
Manchester, England.
:
You can use the LCase function to convert whatever was input into
strictly
lowercase.
You can use the Replace function to remove any internal spaces.
In other words, try the following in the AfterUpdate event of the
control:
Private Sub txtEmailAddress_AfterUpdate()
Me.txtEmailAddress = LCase(Replace(Me.txtEmailAddress, " ", ""))
End Sub
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
My intention is to avoid user to write email addresses like :
(e-mail address removed) or
(e-mail address removed)
(notice the upper case letter)
or like noone@ theweb.com
(notice that a space after the "@")
I don't need to verify the existence of the email address, just the
spelling.
Thanks
Hi Bobby
I can't see how that would be possible.
eg.
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
they may all be correct e mail addesses.
Do you have some criteria that may filter the possblities??
--
Wayne
Manchester, England.
:
Dear All
How to check email address spelling that user have input in a text
box
in a
form (not in table/datasheet )
Thanks