Re: Problem emailing query results

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.



.



Relevant Pages

  • Re: Problem emailing query results
    ... This query generates only one ... Allen Browne - Microsoft MVP. ... "See attached blah blah", True ... assign it to the SQL property of the QueryDef before calling SendObject, ...
    (microsoft.public.access.modulesdaovba)
  • Is there a way around a Type Mismatch Error?
    ... SELECT blah blah ... ...you just can't build it in the query design grid. ... But, of course, you would want to replace CInt with one ... to SQL view to modify the ON statement. ...
    (microsoft.public.access.queries)
  • Re: Problem emailing query results
    ... This query generates only one ... You can now write code that concatenates the various phone numbers, ... "See attached blah blah", True ... assign it to the SQL property of the QueryDef before calling SendObject, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Problem emailing query results
    ... "See attached blah blah", True ... assign it to the SQL property of the QueryDef before calling SendObject, ... I have a report based on a query that very nicely groups my results. ... complex and I can't get it to work from VBA code. ...
    (microsoft.public.access.modulesdaovba)
  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)