A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

send an e-mail to contacts in a report



 
 
Thread Tools Display Modes
  #1  
Old April 10th, 2007, 03:04 PM posted to microsoft.public.access.reports
Gntlhnds
external usenet poster
 
Posts: 97
Default send an e-mail to contacts in a report

I have a report that gets its data from a query, and their e-mail address is
included. I would like to be able to click a button and send an e-mail to
the people that the report generates. How do I do this? I have zero
experience with VB, so please be very detailed.
  #2  
Old April 10th, 2007, 03:16 PM posted to microsoft.public.access.reports
Gntlhnds
external usenet poster
 
Posts: 97
Default send an e-mail to contacts in a report

I have found out that you can't put functioning buttons in a report, but how
about finding a way to generate an email that is automatically addressed to
the list that query comes up with? That would work just as well (preferably
by clicking a button somewhere, wether via the switchboard or whatever).

"Gntlhnds" wrote:

I have a report that gets its data from a query, and their e-mail address is
included. I would like to be able to click a button and send an e-mail to
the people that the report generates. How do I do this? I have zero
experience with VB, so please be very detailed.

  #3  
Old April 10th, 2007, 09:02 PM posted to microsoft.public.access.reports
Jeff C
external usenet poster
 
Posts: 392
Default send an e-mail to contacts in a report

Dim Directors As ADODB.Recordset

Set Directors = New ADODB.Recordset

Directors.Open "tblofyournamesandemailaddresses", CurrentProject.Connection,
adOpenStatic

Do Until Directors.EOF

[Forms]![frm_EMail].[txtDirector].Value = Directors![Name]
[Forms]![frm_EMail].[txtEmail].Value = Directors![E_Mail]

On Error Resume Next
DoCmd.SendObject acSendReport, "nameofyourreport", acFormatSNP,
[Forms]![frm_EMail].[txtEmail], , , "subjectofemail", , True

On Error Resume Next
Directors.MoveNext
Loop

This code placed in the onclick event will generate a report for each
individual and attach it to an email to the individual.

You need a table with the names and email addresses of all the people your
are including.

Directors is just a name but it refers to the table you have with all your
names.

the report must have a record source of a query with the criteria pointing
to textboxes on the form you are using to generate the reports and emails.
--
Jeff C
Live Well .. Be Happy In All You Do


"Gntlhnds" wrote:

I have found out that you can't put functioning buttons in a report, but how
about finding a way to generate an email that is automatically addressed to
the list that query comes up with? That would work just as well (preferably
by clicking a button somewhere, wether via the switchboard or whatever).

"Gntlhnds" wrote:

I have a report that gets its data from a query, and their e-mail address is
included. I would like to be able to click a button and send an e-mail to
the people that the report generates. How do I do this? I have zero
experience with VB, so please be very detailed.

  #4  
Old June 14th, 2007, 01:28 PM posted to microsoft.public.access.reports
guat
external usenet poster
 
Posts: 48
Default send an e-mail to contacts in a report

Jeff C, I'm trying to do exactly what you wrote here, although I too am
unfamiliar with VB. On the form, do I include text boxes of the fields in
Directors? My query will reference this as a text box and not a field?

"Jeff C" wrote:

Dim Directors As ADODB.Recordset

Set Directors = New ADODB.Recordset

Directors.Open "tblofyournamesandemailaddresses", CurrentProject.Connection,
adOpenStatic

Do Until Directors.EOF

[Forms]![frm_EMail].[txtDirector].Value = Directors![Name]
[Forms]![frm_EMail].[txtEmail].Value = Directors![E_Mail]

On Error Resume Next
DoCmd.SendObject acSendReport, "nameofyourreport", acFormatSNP,
[Forms]![frm_EMail].[txtEmail], , , "subjectofemail", , True

On Error Resume Next
Directors.MoveNext
Loop

This code placed in the onclick event will generate a report for each
individual and attach it to an email to the individual.

You need a table with the names and email addresses of all the people your
are including.

Directors is just a name but it refers to the table you have with all your
names.

the report must have a record source of a query with the criteria pointing
to textboxes on the form you are using to generate the reports and emails.
--
Jeff C
Live Well .. Be Happy In All You Do


"Gntlhnds" wrote:

I have found out that you can't put functioning buttons in a report, but how
about finding a way to generate an email that is automatically addressed to
the list that query comes up with? That would work just as well (preferably
by clicking a button somewhere, wether via the switchboard or whatever).

"Gntlhnds" wrote:

I have a report that gets its data from a query, and their e-mail address is
included. I would like to be able to click a button and send an e-mail to
the people that the report generates. How do I do this? I have zero
experience with VB, so please be very detailed.

  #5  
Old June 14th, 2007, 01:44 PM posted to microsoft.public.access.reports
guat
external usenet poster
 
Posts: 48
Default send an e-mail to contacts in a report

Jeff, Sorry to trouble you again. The code is telling me that it doesn't
recognize my field name for this line:
[Forms]![frm_EMail].[txtDirector].Value = Directors![Name]

Perhaps, it's not setting Directors to look at my table? Should the name be
in quotes?
I have exactly:
Private Sub Command4_Click()
Dim Directors As ADODB.Recordset

Set Directors = New ADODB.Recordset
Directors.Open "hrem_admin_tr", CurrentProject.Connection, adOpenStatic

Do Until Directors.EOF

[Forms]![frm_EMail].[txtDirector].Value = Directors![last_name]
[Forms]![frm_EMail].[txtEmail].Value = Directors![andrew_id]

On Error Resume Next
DoCmd.SendObject acSendReport, "Report for Division", acFormatSNP,
[Forms]![frm_EMail].[txtEmail], , , [last_name] & " HRIS June_07", , True

On Error Resume Next
Directors.MoveNext
Loop

End Sub

"Jeff C" wrote:

Dim Directors As ADODB.Recordset

Set Directors = New ADODB.Recordset

Directors.Open "tblofyournamesandemailaddresses", CurrentProject.Connection,
adOpenStatic

Do Until Directors.EOF

[Forms]![frm_EMail].[txtDirector].Value = Directors![Name]
[Forms]![frm_EMail].[txtEmail].Value = Directors![E_Mail]

On Error Resume Next
DoCmd.SendObject acSendReport, "nameofyourreport", acFormatSNP,
[Forms]![frm_EMail].[txtEmail], , , "subjectofemail", , True

On Error Resume Next
Directors.MoveNext
Loop

This code placed in the onclick event will generate a report for each
individual and attach it to an email to the individual.

You need a table with the names and email addresses of all the people your
are including.

Directors is just a name but it refers to the table you have with all your
names.

the report must have a record source of a query with the criteria pointing
to textboxes on the form you are using to generate the reports and emails.
--
Jeff C
Live Well .. Be Happy In All You Do


"Gntlhnds" wrote:

I have found out that you can't put functioning buttons in a report, but how
about finding a way to generate an email that is automatically addressed to
the list that query comes up with? That would work just as well (preferably
by clicking a button somewhere, wether via the switchboard or whatever).

"Gntlhnds" wrote:

I have a report that gets its data from a query, and their e-mail address is
included. I would like to be able to click a button and send an e-mail to
the people that the report generates. How do I do this? I have zero
experience with VB, so please be very detailed.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.