E-Mail in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brccadjchick
    New Member
    • Jul 2007
    • 2

    #1

    E-Mail in Access

    I have some experience with Access but not with advanced features such as integrating e-mail into a database. I created a client contact database for a company, and would like a new Outlook Express e-mail to open (addressed to the particular client), when someone clicks on the e-mail address. I have two tables and a macro, no queries or forms. (But don't mind creating one or both if necessary.)

    I would greatly appreciate it if someone could walk me through this process. I'm under a two week deadline so I'd like to get this done as quickly and simply as possible.

    I'm running Access 2003 on Windows XP Pro. Feel free to let me know if you need anymore details. Thanks so much!
  • damonreid
    Recognized Expert New Member
    • Jul 2007
    • 114

    #2
    You can send e-mails using the SendObject command.
    This can auto e-mail reports or tables to pre-selected or post-selected person(s).

    [code=vb]DoCmd.SendObjec t acSendTable, "Employees" , acFormatXLS, _
    "Nancy Davolio; Andrew Fuller", "Joan Weber", , _
    "Current Spreadsheet of Employees", , False[/code]

    DoCmd.SendObjec t ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile

    The best thing to do it make a list box with all the e-mail addresses in it (E.g. lstEmailAddress es) and have a for loop to add all the e-mail addresses into a string (E.g. strTo for the to field and strCc, strBcc for the CC and BCC fields if you want them added to that instead).

    [code=vb]Dim strTO As String
    Dim strCc As String
    Dim rptcount As Long
    Dim cnt As Long

    If Me.lstEMailAddr esses.ItemsSele cted.Count = 0 Then
    MsgBox "No email addresses have been selected; please select one or more email addresses, and then try again."
    Else

    For cnt = 0 To Me.lstEMailAddr esses.ItemsSele cted.Count - 1
    strTO = strTO & ";" & Me.lstEMailAddr esses.Column(0, Me.lstEMailAddr esses.ItemsSele cted(cnt))
    Next cnt
    strTO = Mid(strTO, 2)[/code]

    Hope this helped.
    Last edited by damonreid; Jul 17 '07, 08:47 AM. Reason: Typo

    Comment

    • brccadjchick
      New Member
      • Jul 2007
      • 2

      #3
      Thanks so much for replying and trying to help! However, I am a bit lost here. Could you please clarify your instructions for a beginner like me? :-)

      Comment

      • damonreid
        Recognized Expert New Member
        • Jul 2007
        • 114

        #4
        You should make a query that takes all the e-mail addresses and the companies.

        Then make a form and put a list box with the source being the e-mail addresses in your query. You can then put a combo box with the company’s names in it to filter the query and limit the list of e-mail addresses. What happens then is when you select a company from your combo box then only the e-mail addresses associated with that company should be in your list box.

        Form Name: emailform
        Combo Box Name: Combo0
        List Box Name: lstEMailAddress es

        So on your query you should have
        [code=vb][Forms]![emailform]![Combo0][/code]
        in the company field. This will filter your list box lstEMailAddress es.

        Once you get this working let me know and I will post the next part.

        Comment

        Working...