Inserting multiple rows into an email created by VBA (1 Viewer)

chuckcoleman

Registered User.
Local time
Today, 12:13
Joined
Aug 20, 2010
Messages
363
Hi, I have been using VBA to send an email for several years now. The email is generated from a form where payments are inserted for property lots. Things have changed and I now need to include in the email information how much the payment was for each lot. For instance, owner ID number 21 owns Lot number 445 just paid $600 in addition to paying $300 on lot number 446. Therefore, instead of something relatively simple, I now need to essentially include two or more rows from a query in the email.

Any suggestions on a way to accomplish this?

Chuck
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 10:13
Joined
Aug 30, 2003
Messages
36,127
I would open a DAO recordset on the query and loop through it, adding to the body within the loop.
 

chuckcoleman

Registered User.
Local time
Today, 12:13
Joined
Aug 20, 2010
Messages
363
I would open a DAO recordset on the query and loop through it, adding to the body within the loop.
Thank you. I’ll try your suggestion tomorrow morning.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 10:13
Joined
Aug 30, 2003
Messages
36,127
No problem, post back if you get stuck. I have automated apps that do this type of thing.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 01:13
Joined
May 7, 2009
Messages
19,247
you need to use Outlook automation or CDO, if you don't have the code yet.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:13
Joined
Sep 21, 2011
Messages
14,332
Here is how I did something similar.
However this takes into account several records for a client, deposits or payments.

Yours could just be the table with the values that I get from each record.

Had to attach as too large to paste.
 

Attachments

  • Send Email VBA.txt
    13.2 KB · Views: 20

ebs17

Well-known member
Local time
Today, 19:13
Joined
Feb 7, 2020
Messages
1,949
I now need to essentially include two or more rows from a query in the email.
How do you add the one line so far?
For ease of use, this would be the interesting place to meet your requirements.
 

Users who are viewing this thread

Top Bottom