email several reports using Do Loop and Recordset

F

FSHOTT

Can someone direct me on how to use a Recordset field in a Report I create in
a VBA module and use as an attachment to a MS Outlook Message? Also is there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature? My Recordset is a Table of
Suppliers and their E-mail Information (SupplierID, SupplierName,
EmailPersonName, EmailAddress,EmailMessage). I would like to Loop through the
records using some of the fields in the generation of the report. I have
tried several methods to identify the recordset field in the report but to
date have not the correct syntax. I appreciate any help. Thank You!
 
M

Mark Andrews

I'm sure that is all possible. I don't use Outlook automation because I
usually build solutions for people that might not have Outlook installed. I
will let another person help with the Microsoft Outlook automation.

Here's a sample of simple looping thru a recordset:
http://www.granite.ab.ca/access/email/recordsetloop.htm

If you are interested in getting away from relying on Outlook and don't mind
just throwing an extra DLL into the mix you can always just use an SMTP
component to do everything you need with email.
Here's a quick example of using the Ostrosoft SMTP component:
http://www.rptsoftware.com/products/email/

Just providing another opinion or route to go,
Mark
 
T

Tony Toews [MVP]

FSHOTT said:
Can someone direct me on how to use a Recordset field in a Report I create in
a VBA module and use as an attachment to a MS Outlook Message? Also is there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature?

You've already got one link to my website. Here's another one which
will answer your other questions.

See the Outlook specific links at the Access Email FAQ at my website.
http://www.granite.ab.ca/access/email/outlook.htm

Tony
 
F

FSHOTT

Mark & Tony Thank You very much for your responses. I reading the articles in
the WEB pages you directed me to. I still am unable to understand for to
identify a Recordset field in a Report. Would it be something like
[Module1]![MyRS]![EmailPersonName] ? Where Module1 is the VBA code to loop
through the table of Email users and info, MyRS is the recordset the table is
assigned to and EmailPersonName is the name of the person that the Report is
being emailed to.
 
M

Mark Andrews

recordsets are driven off a table or query.

usually the syntax is
strEmail = RS("Email")

where strEmail is a variable and "Email is the name of the field in your
table/query/recordset

So for instance you might have a query that identifies the 30 customers you
want to email.
You loop through the recordset (of the 30 records) and either send 30 emails
or send one email to 30 email addresses. You use string variables to
capture data as you do the looping or to put together text for the body of
the email etc....

HTH,
Mark
RPT Software
http://www.rptsoftware.com



FSHOTT said:
Mark & Tony Thank You very much for your responses. I reading the articles
in
the WEB pages you directed me to. I still am unable to understand for to
identify a Recordset field in a Report. Would it be something like
[Module1]![MyRS]![EmailPersonName] ? Where Module1 is the VBA code to
loop
through the table of Email users and info, MyRS is the recordset the table
is
assigned to and EmailPersonName is the name of the person that the Report
is
being emailed to.
--
frank-a


FSHOTT said:
Can someone direct me on how to use a Recordset field in a Report I
create in
a VBA module and use as an attachment to a MS Outlook Message? Also is
there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature? My Recordset is a
Table of
Suppliers and their E-mail Information (SupplierID, SupplierName,
EmailPersonName, EmailAddress,EmailMessage). I would like to Loop through
the
records using some of the fields in the generation of the report. I have
tried several methods to identify the recordset field in the report but
to
date have not the correct syntax. I appreciate any help. Thank You!
 
F

FSHOTT

Mark Thank you yes I understand your reply and that part of the code works
fine. I believe I have fundamental hole in my understanding on how to get
field data from my table/query/recordset (current record) into a report I
create as an attachment to the Outlook Message. There are some areas of
ACCESS and VBA syntax I clearly do not understand. This seems to be driving
me nuts.
--
frank-a


Mark Andrews said:
recordsets are driven off a table or query.

usually the syntax is
strEmail = RS("Email")

where strEmail is a variable and "Email is the name of the field in your
table/query/recordset

So for instance you might have a query that identifies the 30 customers you
want to email.
You loop through the recordset (of the 30 records) and either send 30 emails
or send one email to 30 email addresses. You use string variables to
capture data as you do the looping or to put together text for the body of
the email etc....

HTH,
Mark
RPT Software
http://www.rptsoftware.com



FSHOTT said:
Mark & Tony Thank You very much for your responses. I reading the articles
in
the WEB pages you directed me to. I still am unable to understand for to
identify a Recordset field in a Report. Would it be something like
[Module1]![MyRS]![EmailPersonName] ? Where Module1 is the VBA code to
loop
through the table of Email users and info, MyRS is the recordset the table
is
assigned to and EmailPersonName is the name of the person that the Report
is
being emailed to.
--
frank-a


FSHOTT said:
Can someone direct me on how to use a Recordset field in a Report I
create in
a VBA module and use as an attachment to a MS Outlook Message? Also is
there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature? My Recordset is a
Table of
Suppliers and their E-mail Information (SupplierID, SupplierName,
EmailPersonName, EmailAddress,EmailMessage). I would like to Loop through
the
records using some of the fields in the generation of the report. I have
tried several methods to identify the recordset field in the report but
to
date have not the correct syntax. I appreciate any help. Thank You!
 
M

Mark Andrews

Frank,

Email me some detailed information about what you are trying to do. Use the
contact email or contact form on my website and I'll try and give you a
better understanding of what you need.

Perhaps you are looking into how to loop thru a bunch of records and for
each record create a file and then crewate an email and attach this file.
The file is created by running a report for the data on that specific
record.

Mark
RPT Software
http://www.rptsoftware.com

FSHOTT said:
Mark Thank you yes I understand your reply and that part of the code works
fine. I believe I have fundamental hole in my understanding on how to get
field data from my table/query/recordset (current record) into a report I
create as an attachment to the Outlook Message. There are some areas of
ACCESS and VBA syntax I clearly do not understand. This seems to be
driving
me nuts.
--
frank-a


Mark Andrews said:
recordsets are driven off a table or query.

usually the syntax is
strEmail = RS("Email")

where strEmail is a variable and "Email is the name of the field in your
table/query/recordset

So for instance you might have a query that identifies the 30 customers
you
want to email.
You loop through the recordset (of the 30 records) and either send 30
emails
or send one email to 30 email addresses. You use string variables to
capture data as you do the looping or to put together text for the body
of
the email etc....

HTH,
Mark
RPT Software
http://www.rptsoftware.com



FSHOTT said:
Mark & Tony Thank You very much for your responses. I reading the
articles
in
the WEB pages you directed me to. I still am unable to understand for
to
identify a Recordset field in a Report. Would it be something like
[Module1]![MyRS]![EmailPersonName] ? Where Module1 is the VBA code to
loop
through the table of Email users and info, MyRS is the recordset the
table
is
assigned to and EmailPersonName is the name of the person that the
Report
is
being emailed to.
--
frank-a


:

Can someone direct me on how to use a Recordset field in a Report I
create in
a VBA module and use as an attachment to a MS Outlook Message? Also is
there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature? My Recordset is a
Table of
Suppliers and their E-mail Information (SupplierID, SupplierName,
EmailPersonName, EmailAddress,EmailMessage). I would like to Loop
through
the
records using some of the fields in the generation of the report. I
have
tried several methods to identify the recordset field in the report
but
to
date have not the correct syntax. I appreciate any help. Thank You!
 
F

FSHOTT

Mark I send you details of my database and hopefully a more detailed and
clear description of what I am trying to do. I appreciate your efforts toward
my questions
--
frank-a


Mark Andrews said:
Frank,

Email me some detailed information about what you are trying to do. Use the
contact email or contact form on my website and I'll try and give you a
better understanding of what you need.

Perhaps you are looking into how to loop thru a bunch of records and for
each record create a file and then crewate an email and attach this file.
The file is created by running a report for the data on that specific
record.

Mark
RPT Software
http://www.rptsoftware.com

FSHOTT said:
Mark Thank you yes I understand your reply and that part of the code works
fine. I believe I have fundamental hole in my understanding on how to get
field data from my table/query/recordset (current record) into a report I
create as an attachment to the Outlook Message. There are some areas of
ACCESS and VBA syntax I clearly do not understand. This seems to be
driving
me nuts.
--
frank-a


Mark Andrews said:
recordsets are driven off a table or query.

usually the syntax is
strEmail = RS("Email")

where strEmail is a variable and "Email is the name of the field in your
table/query/recordset

So for instance you might have a query that identifies the 30 customers
you
want to email.
You loop through the recordset (of the 30 records) and either send 30
emails
or send one email to 30 email addresses. You use string variables to
capture data as you do the looping or to put together text for the body
of
the email etc....

HTH,
Mark
RPT Software
http://www.rptsoftware.com



Mark & Tony Thank You very much for your responses. I reading the
articles
in
the WEB pages you directed me to. I still am unable to understand for
to
identify a Recordset field in a Report. Would it be something like
[Module1]![MyRS]![EmailPersonName] ? Where Module1 is the VBA code to
loop
through the table of Email users and info, MyRS is the recordset the
table
is
assigned to and EmailPersonName is the name of the person that the
Report
is
being emailed to.
--
frank-a


:

Can someone direct me on how to use a Recordset field in a Report I
create in
a VBA module and use as an attachment to a MS Outlook Message? Also is
there
a way to Email messages and attached reports without encountering (or
bypassing) the Microsoft Outlook Security Feature? My Recordset is a
Table of
Suppliers and their E-mail Information (SupplierID, SupplierName,
EmailPersonName, EmailAddress,EmailMessage). I would like to Loop
through
the
records using some of the fields in the generation of the report. I
have
tried several methods to identify the recordset field in the report
but
to
date have not the correct syntax. I appreciate any help. Thank You!
 

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