Re: Problem emailing query results
- From: Ray S. <RayS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 9 Jun 2006 07:12:03 -0700
OOPS...Never mind about the password question...I figured that out...
I still have the problem of grouping...
Simple case:
Table:
FN
LN
PH
Query:
Cleans MI from FN field and concatenates FN.LN.@xxxxxxxxxxxxx as Email field
Simply entering two records with same FN and LN but different PHs will
illustrate.
When I SendObject I have to replace "RayS@xxxxxxxxxxxxxxxxxxxxxxxxx" in the
example below with each instance of FN.LN.@xxxxxxxxxxxxx, and also make sure
that the attached query shows FN LN and the TWO (or more, up to seven)
grouped PHs.
I'd like the body or my emails to be basically:
Dear <<FN>>,
You have the following phone numbers:
PH
PH
PH
PH
(the result of the on LN grouped query)
Please, blah blah
Thanks,
Ray S.
"Allen Browne" wrote:
If you have created a query, you can attach it to an email with this:.
DoCmd.SendObject acSendQuery, "MyQuery", acFormatTXT , _
"RayS@xxxxxxxxxxxxxxxxxxxxxxxxx", , , "Here's your query", _
"See attached blah blah", True
If you need to use a dynamic SQL statement, create one for this job, and
assign it to the SQL property of the QueryDef before calling SendObject,
e.g.:
CurrentDb.QueryDefs("MyQuery").SQL = strSql
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Ray S." <RayS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D280BF31-AFCC-422F-9749-53126A6F6345@xxxxxxxxxxxxxxxx
I've asked for help on this in the Word and Outlook forums as well as
here,
but in ove a week I have receive NOT EVEN a response.
I have a report based on a query that very nicely groups my results.
I've recently posted for help on the syntax of my query because it's
pretty
complex and I can't get it to work from VBA code.
I hope that if I can get it to work in code then I can use the results to
do
an emailing.
I just posted the SQL under the subject title SQL syntax.
- Follow-Ups:
- Re: Problem emailing query results
- From: Allen Browne
- Re: Problem emailing query results
- References:
- Re: Problem emailing query results
- From: Allen Browne
- Re: Problem emailing query results
- Prev by Date: How to call an external function ??
- Next by Date: Re: Problem emailing query results
- Previous by thread: Re: Problem emailing query results
- Next by thread: Re: Problem emailing query results
- Index(es):
Relevant Pages
|