I have a field in a table that stores email addresses (hyperlink data type). I am trying to write what should be very simple code to delete the "mailto" if its there from the front of an email address (it was company policy to do that some months back). I do not seem to be able to make the code stop at an email address that starts with "Mailto:" at the front of it. I have already ran some code that sorts out the acAddress, acSubAddress and acDisplay properties so they open up in exchange properly but am now not sure why I can't get this bit to work.
Code I have been working on is:
Dim stDisplayText As String
Dim rs As DAO.Recordset
Dim i, NoRecs As Integer
Set rs = CurrentDb.OpenRecordset("MyRecs"
rs.MoveLast
NoRecs = rs.RecordCount
rs.MoveFirst
For i = 0 To NoRecs - 1
If Len(rs![e-mail address]) > 0 Then
stDisplayText = HyperlinkPart(rs![e-mail address], acDisplayText)
If stDisplayText like "mailto:*" Then
stDisplaytext = Right$(stDisplayText) - 8
Debug.Print stDisplayText
......code to update table with new display email address
End If
End if
rs.MoveNext
Next
rs.close
Any help much appreciated.
Thanks
Code I have been working on is:
Dim stDisplayText As String
Dim rs As DAO.Recordset
Dim i, NoRecs As Integer
Set rs = CurrentDb.OpenRecordset("MyRecs"

rs.MoveLast
NoRecs = rs.RecordCount
rs.MoveFirst
For i = 0 To NoRecs - 1
If Len(rs![e-mail address]) > 0 Then
stDisplayText = HyperlinkPart(rs![e-mail address], acDisplayText)
If stDisplayText like "mailto:*" Then
stDisplaytext = Right$(stDisplayText) - 8
Debug.Print stDisplayText
......code to update table with new display email address
End If
End if
rs.MoveNext
Next
rs.close
Any help much appreciated.
Thanks