• Hyperlink for email

    Author
    Topic
    #352807

    If I create a hyperlink field and put a web page address in it, when I click on the address it goes to the site. Very nice.

    If I create a hyperlink field and put in “Mailto:xyz@abc.qwe” and click on the hyperlink it opens up my e-mail and puts the address in the “To” textbox (at least this works in Outlook and Outlook Express). Also, very nice.

    What is not so nice is that I have to keep on typing “Mailto:” at the beginning of each field for email. Also, I have to look at the words “Mailto:” in the field. Is there a way I can have these words automagically be placed in the field but be invisible?

    Thanks.

    Viewing 2 reply threads
    Author
    Replies
    • #514262

      Hi John,
      What you could do is have the email address entered into a text box, then have a command button next to it with the following in the click event:
      application.followhyperlink “mailto:” & me.txtTextBoxName
      Hope that helps.

    • #514326

      If you type fmu@telstra.com in word it makes a hyperlink automatically and does not show mailto: except in the tooltip which appears if you hover over it.

      This is done in “autoformat a you type” which is on menu item Insert/autotext/autotext. There is a box for automatically insert hyperlinks.

      OOPS! My brain was in Word, not Access.

    • #524511

      I use the code below to deal with the problem.

      Private Sub CEmail_AfterUpdate()
      Dim strEmail As String

      If Len(Me.CEmail) > 0 Then
      strEmail = Left(Me.CEmail, InStr(Me.CEmail, “#”) – 1)
      strEmail = strEmail & “#mailto:” & strEmail & “#”
      Me.CEmail = strEmail
      End If

      End Sub

      HTH

      Cheers!!

      Tim K.
      Thailand

      • #524552

        I tried it, but it didn’t work for me. It took me to the web site of the email address (eg. to Hotmail for xyz@hotmail.com).

        Any idea what I did wrong? I don’t know Visual Basic, so I just copied and pasted your code. For example, I have no idea what Me.Cemail means.

        • #524556

          Hi John,

          “Cemail” is the field/textbox name that Tim K. used in his example. “Me” refers to the current form. You would need to replace every instance of “Cemail” with the name of your field or textbox where the email address is being entered. For example “Me.EmailAddress” or something.

          Post back if you need further assistance.

          • #526123

            I have to apologize, but I have tried to do this several times using both methods (button and script). Is it possible for somebody to send me a step by step procedure of what to do and where to put the code.

            Thanks.

    Viewing 2 reply threads
    Reply To: Hyperlink for email

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: