Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlink for email

    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.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hyperlink for email

    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.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hyperlink for email

    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.
    David Grugeon
    Brisbane Australia

  4. #4
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink for email

    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

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink for email

    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.

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink for email

    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.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink for email

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •