G
Guest
Can you tell me what is wrong with "IsNothing" in my code?
Private Sub Email_AfterUpdate()
' If you just type in an email name: (e-mail address removed)
' Access changes it to: [email protected]#http://[email protected]# !!
' This code tries to fix it
Dim intI As Integer
' Don't do anything if email is empty
If IsNothing(Me.PMemailAddress) Then Exit Sub
' Fix up http:// if it's there
Me.PMemailAddress = Replace(Me.PMemailAddress, "http://", "mailto:")
' Now look for the first"#" that delimits the hyperlink display name
intI = InStr(Me.PMemailAddress, "#")
' And put the person name there instead if found
If intI > 0 Then
Me.PMemailAddress = (Me.PMemailAddress + " ") & Me.LastName & _
Mid(Me.PMemailAddress, intI)
End If
End Sub
Private Sub Email_AfterUpdate()
' If you just type in an email name: (e-mail address removed)
' Access changes it to: [email protected]#http://[email protected]# !!
' This code tries to fix it
Dim intI As Integer
' Don't do anything if email is empty
If IsNothing(Me.PMemailAddress) Then Exit Sub
' Fix up http:// if it's there
Me.PMemailAddress = Replace(Me.PMemailAddress, "http://", "mailto:")
' Now look for the first"#" that delimits the hyperlink display name
intI = InStr(Me.PMemailAddress, "#")
' And put the person name there instead if found
If intI > 0 Then
Me.PMemailAddress = (Me.PMemailAddress + " ") & Me.LastName & _
Mid(Me.PMemailAddress, intI)
End If
End Sub