Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email address in Access 97 (97)

    I would like to know if VBA /Access allows processing of a text address such as xyz@abc.com. in a text box with the result of setting up a blank email with that address already inserted.
    i.e.
    * A textbox bound to a text field contains email addresses.
    * A command button adjacent to the textbox, when pressed, will cause Access to open a new Outlook message with the email address already inserted.

    I can get this this result if I make the field datatype "hyperlink" and prepend "mailto:" to each email address, e.g. mailto:xyz@abc.com. However this means extra work for my client and the increased possibility of errors. Also hyperlinks are harder to edit if they're wrong so I would prefer to keep to text datatype.

    Thanks for any suggestions.

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Email address in Access 97 (97)

    I use this type of setup on a personnel data form. The e-mail address field is a text field, not hyperlink. I've tried using hyperlink fields but always have problems using them. On the form, there's an "E-Mail" button next to the e-mail textbox. When you click the button, the following code is executed: <pre> If Not IsNull(Me.EMAIL_txt) Then
    Me.Email_btn.Hyperlink.Address = "mailto:" & Me.EMAIL_txt
    Else
    Me.Email_btn.Hyperlink.Address = ""
    Beep
    MsgBox "No e-mail address is entered.", vbCritical, "NO ADDRESS"
    End If
    </pre>

    A new, blank e-mail message pops up with e-mail address entered. This works with Outlook 2K and Outlook Express.
    HTH

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email address in Access 97 (97)

    Have a look at this post.
    The only difference for Access 97 is to set the reference to Microsoft Outlook 8.0 Object Model
    Francois

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Email address in Access 97 (97)

    We use the technique suggested by Francios (double click the text box) frequently for email addresses, and also for automated faxing and phone dialing. His code is simple and straightforward, though you may want to put some error handling in for your users.
    Wendell

Posting Permissions

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