Using Query like source to mass emails

A

Alogon

Suppose a query with Field A and A1, A2, … are its values; Field B and B1,
B2, …
In a record, A1 could be associated with B1 and with B3 in another record;
A2 could be associated with B2, B5 and B8 in others records…
Suppose A Field like Customers Field. I want to email A1 and mention (in
this email) all B values associated with A1 value. And so makes the same for
all A values.
How can I do that?
 
P

Piet Linden

Suppose a query with Field A and A1, A2, … are its values; Field B and B1,
B2, …
In a record, A1 could be associated with B1 and with B3 in another record;
A2 could be associated with B2, B5 and B8 in others records…
Suppose A Field like Customers Field. I want to email A1 and mention (in
this email) all B values associated with A1 value. And so makes the same for
all A values.
How can I do that?

You would have to open a recordset based on your parent table (seems
like table or query A) and then pass the foreign key of A as an
argument to filter recordset B. ("SELECT <fieldlist> FROM tblB WHERE
FK=" & rsA.Fields("ForeignKey")).

Then you could loop through that and put it somewhere. Or you could
use fConcatChild in a query and then open a recordset based on that
query and loop through it sending e-mails.
 
A

Alogon

Ok Piet, the fConcatChild function dealt well with the original question. I
thank you very much for this.

In reality, however, there are not only Field B associated with Field A but
a list of fields (let say Field C, Field D...) so that it'd better if I could
send email to A1 (Field A value) associated with a subreport (or subform, I
don't know for sure) that shows more than just one Field.

Can I send (via Outlook or html) to A1 (and so to A2, A3...) a Report that
contains a Subreport in?

I have spent a lot of time looking for a answer without success. Please help
me.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top