emailing a client selected from a combo box

prmitchell

Registered User.
Local time
Today, 21:29
Joined
Jan 2, 2013
Messages
58
wish to a report to a selected client's email address where the client (Client ID) is selected by the user from a combo box.
I have tried

DoCmd.SendObject acReport, "Report for selected client", "PDFFormat(*.pdf)", "[ClientID]=”&ClientID, "", "", "", "subject", True, ""

which leads to an email message opening where the To is
[ClientID] = pm

The SQL I have in mind is

SELECT ClientID, email
FROM Clients
Where Clients.ClientID = Form![formname].[ClientID]

hope this helps, or just the first paragraph
 
Not sure if I get it, but you could use a dlookup to retreive the mail in case it stored in a table:

Code:
dlookup("[e mail"], "clients", "Clients.ClientID ='" & Form![formname].[ClientID] & "'"

call it as following:

Code:
dim clientid as string
dlookup("[e mail"], "clients", "Clients.ClientID ='" & Form![formname].[ClientID] & "'"
 
DoCmd.SendObject acReport, "Report for selected client", "PDFFormat(*.pdf)", ClientID, "", "", "", "subject", True, ""

I never used sendobject to send mail so I am assuming that the TO adres is in the correct place you mentioned.

ps. remove the space in e mail. The forum didn't allow me to post that text as I'm under 10 forum posts...
 

Users who are viewing this thread

Back
Top Bottom