PDA

Click to See Complete Forum and Search --> : KeyAscii in KeyPress event


myemmy
Nov 9th, 1999, 02:06 AM
I am trying to code a textbox to only accept e-mail addresses.

I am using the "If KeyAscii =" code, and I know it needs to accept backspace, decimal, upper and lower case letters, numbers, "@" and _, and can't get it to work.

Can anyone help?

Myemmy
myemmy@hotmail.com

Nov 9th, 1999, 02:25 AM
why bother using the keyascii, when you could check the email in the LOST FOCUS event, this would free up the processor more...

use something like:

If Not LCase(Text1.Text) Like "*@*.*" Then
'put code her to display an error message because the email is not a valid one.
End If


mail me if you want a working sample

------------------

Wossname,
Email me: wossnamex@talk21.com :)