Dragonzstealth
New Member
- Joined
- Jan 27, 2006
- Messages
- 13
Hi guys, just wondering if anyone out there in internet land knows an input mask for e-mail addresses. I'm apparently too dumb to figure this one out on my own. Thanks.
[MyField]) like "?*@?*.?*"
<&&&&&CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
LenB([MyField])>8 and lenB([MyField]) < 102
(LenB([MyField]) - LenB(Replace([MyField], "@", ""))) / LenB("@")=1
[MyField] like "?*@?*.?*" and LenB([MyField])>8 and lenB([MyField]) < 102 and (LenB([MyField]) - LenB(Replace([MyField], "@", ""))) / LenB("@")=1
Sub SplitTest()
Debug.Print UBound(Split("giacomo.spam@gmail.com", "@"))
Debug.Print UBound(Split("giacomo@spam@gmail.com", "@"))
Debug.Print UBound(Split("giacomo.spam@@gmail.com", "@"))
Debug.Print UBound(Split("giacomo.spam.gmail.com", "@"))
End Sub
That is pretty nifty except you can't use UDFs or the UBound/Split commands in table level validation. (I think you might be able to if you turn off sandboxmode, but I don't want to do that.)
Function CountOccurrences(str, substring) As Long
' Returns the number of times substring appears in str
Dim x As Variant
x = Split(str, substring)
CountOccurrences = UBound(x)
End Function
SELECT CountOccurrences([email_addr],"@") AS AtCount
FROM someTable;