Had to work it out for myself - here it is if anyone wants
it.
No leading or trailing dot.
There must be a name part, then an @, then a domain part
Name can only contain a-z, 0-9, hyphen, underscore or dot -
dot is not mandatory
Domain can only contain a-z, 0-9, hypen or dot and the dot
is mandatory
Here's the after update code for the field EMail :-
Dim tCount, tWheresAt, tNameError, tDomainError,
tDomainDot As Long
Dim tName, tDomain As String
tWheresAt = InStr(Me.EMail, "@")
tName = Left(Me.EMail, tWheresAt - 1)
tDomain = Right(Me.EMail, Len(Me.EMail) - tWheresAt)
If tWheresAt = 0 Then
MsgBox "No @ sign in e-mail address - please re-
enter", vbOKOnly, "EMail validation"
Me.EMail = Null
DoCmd.GoToControl "EMail"
Exit Sub
End If
If tName = "" Or Left(tName, 1) = "." Or Right(tName,
1) = "." Then
tNameError = 1
End If
tCount = 0
For tCount = 1 To Len(tName)
If (Mid(tName, tCount, 1) Like "[a-z]" Or Mid
(tName, tCount, 1) Like "[0-9]" Or Mid(tName, tCount, 1)
= "-" Or Mid(tName, tCount, 1) = "_" Or Mid(tName, tCount,
1) = ".") And Asc(Mid(tName, tCount, 1)) <> 42 Then
' okay
Else
tNameError = 1
End If
Next
If tNameError = 1 Then
MsgBox "Name part of e-mail address contains
invalid characters - please re-enter", vbOKOnly, "EMail
validation"
Me.EMail = Null
DoCmd.GoToControl "EMail"
Exit Sub
End If
tDomainError = 0
tDomainDot = 0
If tDomain = "" Or Left(tDomain, 1) = "." Or Right
(tDomain, 1) = "." Then
tDomainError = 1
End If
tCount = 0
For tCount = 1 To Len(tDomain)
If (Mid(tDomain, tCount, 1) Like "[a-z]" Or Mid
(tDomain, tCount, 1) Like "[0-9]" Or Mid(tDomain, tCount,
1) = "-" Or Mid(tDomain, tCount, 1) = ".") And Asc(Mid
(tDomain, tCount, 1)) <> 42 Then
' okay
Else
tDomainError = 1
End If
If Mid(tDomain, tCount, 1) = "." Then
tDomainDot = 1#
End If
Next
If tDomainError = 1 Then
MsgBox "Domain name part of e-mail address
contains invalid characters - please re-enter",
vbOKOnly, "EMail validation"
Me.EMail = Null
DoCmd.GoToControl "EMail"
Exit Sub
End If
If tDomainDot = 0 Then
MsgBox "Domain name part of e-mail address does
not contain a dot - please re-enter", vbOKOnly, "EMail
validation"
Me.EMail = Null
DoCmd.GoToControl "EMail"
Exit Sub
End If
End Sub