Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening Email from a form (2002)

    Hello

    I have a form with a field to store an email address for a customer, how can I open a new email message ready to use when I click the email address on the form?

    Regards
    Hayden

    PS I have tried to set the Data Type in the table thats stores the address as a hyperlink but that seems to open a web address

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening Email from a form (2002)

    You can use code like this in an event handler:

    Application.FollowHyperlink "mailto:" & Me.txtEMail

    where txtEmail is the name of the text box.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    London, Gtr London
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening Email from a form (2002)

    Thanks Hans

    I think I have understood what you have said but when the email opens, the 'To:' address looks something like this: hayden@woodys.co.uk#<a href="http://...odys.co.uk</a>#

    I have tried setting the data type to text and then back to hyperlink but I get the same result.

    Also just to confirm:

    I have inserted the line of code into the 'On Click' event of the text box, is this correct?

    Regards
    Hayden

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening Email from a form (2002)

    A hyperlink field is in reality a memo field, the text consists of three parts separated by # characters. The first and last part can be empty.
    First part: display text
    Middle part: hyperlink address or mailto: address
    Last part: subaddress, for instance a bookmark within a document. Must be empty for mailto: addresses.

    If your field is a text field, you don't need all those parts, so you should remove everything except the middle part between the # characters. If necessary, you can use an update query for this.

    If your field is a hyperlink field, you should insert mailto: in front of the middle part; you won't need code at all then, for clicking the hyperlink will then automatically generate an e-mail.

    You can use the On Click event, but that means that the user won't be able to enter or edit anything. You might use On Dbl Click instead.

Posting Permissions

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