Hi I am new to access 2010. I have created a form that queries a table to display 2 (1 Viewer)

nickblitz

Registered User.
Local time
Tomorrow, 02:04
Joined
Oct 29, 2012
Messages
30
Hi I am new to access 2010.

I have created a form that queries a table to display 2 sets of information which is email and secondary emails for a specific type of user.

I have tried different codes that indeed work by opening up a email client with the subject but then it does not show all the email which is on the form.

I need to have a code that displays all the email in the to: in outlook.

anyone can help? thanks. :)
 

CHAOSinACT

Registered User.
Local time
Tomorrow, 04:04
Joined
Mar 18, 2009
Messages
235
Hi I am new to access 2010.

I have created a form that queries a table to display 2 sets of information which is email and secondary emails for a specific type of user.

I have tried different codes that indeed work by opening up a email client with the subject but then it does not show all the email which is on the form.

I need to have a code that displays all the email in the to: in outlook.

anyone can help? thanks. :)

What code are you using? I use this:
Code:
    DoCmd.SendObject acSendReport, "<<sending attachement>>", _
    << attachment type>>, <<"recipients">>, , , "<<message subject>>", _
    "<<message body>>", _
    True

is this what you are using? maybe the question isn't clear, don't you just include the to in the recipients section?
 

pr2-eugin

Super Moderator
Local time
Today, 19:04
Joined
Nov 30, 2011
Messages
8,494
This is the email procedure that I use.. let me know if this is hard to follow..
Code:
Public Sub sendEmail()
    [COLOR=SeaGreen]'Define variables[/COLOR]
    Dim strTo As String
    Dim strCC As String
    Dim strSubject As String
    Dim strMessage As String
    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem

   [COLOR=SeaGreen] 'Assign values to defined variables[/COLOR]
    strTo = "someone@somedomain.com"
    [COLOR=SeaGreen]'strCC = "ifyouwant@youcan.co.uk"[/COLOR]
    strSubject = "EMail from Access"

    [COLOR=SeaGreen]'Create message[/COLOR]
    strMessage = "This will be your message, you can also get values from forms like" & Me.textBoxName

    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

   [COLOR=SeaGreen] 'Display the message[/COLOR]
    With objOutlookMsg
        objOutlookMsg.To = strTo
        .CC = strCC
        .Subject = strSubject
        .Body = strMessage
        .BodyFormat = olFormatHTML
        .Importance = olImportanceNormal
        .Display
    End With

    Set objOutlook = Nothing
End Sub
 

Users who are viewing this thread

Top Bottom