Mass change from http:// to mailto:

  • Thread starter Thread starter Roanette
  • Start date Start date
R

Roanette

Guest
How do you make a mass table change from http:// to mailto:. I made the field hyperlink but I wanted it to be able to email the contact.

Please help. :confused:
 
Not sure I understand:

Is there a mailto field type in later versions of Access ? I can't see one in Access 2000. If there is, just make a copy of the table and try changing the field type - it can only fall over in a big heap!

Is the data in the field an e-mail address or a web site address ? if E Mail addresses why not just change it to a text field. If they are web site addresses, they won't be valiid EMail addresses ( or will they .... )


:confused:
 
Here is your solution. Look through the code and adjust your form accordingly. Basically, you will need to add a textbox named firstname, lastname and emailname. The control source for the emailname textbox must be the hyperlink type.


Private Sub EmailName_AfterUpdate()
' If you just type in an email name: PeteDetlef@IndianaUniversity.edu
' Access changes it to: PeteDetlef@IndianaUniversity.edu #http://PeteDetlef@IndianaUniversity.edu# !!
' This code tries to fix it
Dim intI As Integer

' Don't do anything if email is empty
If IsNothing(Me.EmailName) Then Exit Sub

' Fix up http:// if it's there
Me.EmailName = Replace(Me.EmailName, "http://", "mailto:")

' Now look for the first "#" that delimits the hyperlink display name
intI = InStr(Me.EmailName, "#")
' And put the person name there instead if found
If intI > 0 Then
Me.EmailName = (Me.FirstName + " ") & Me.LastName & Mid(Me.EmailName, intI)
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom