Email report that is filtered to one record


J

J.Bennett

I have a database that has three different forms. To navigate from one form
to the other and keep the same record, I have an [Event Procedure] set up.
Additionally, to print the report for the one recored, I have another [Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:

Private Sub printallpages_Click()

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub

I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.

I can simply do the "Preview Report" with the one item, then use the option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....

I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.

Any help would be greatly appreciated.

James Bennett
 
Ad

Advertisements

J

J.Bennett

Thanks for the suggestion. Unfortunately, I don't think this helps. I have
no problem with creating the pdf as you can preview the report and then
simply select the emai button, it prompts you for the format (which PDF is an
option) and it attaches it to the email. This works as the "preview" is
already filtered down to one record as indicated below. However, what I am
seeking is a way to NOT have to go the preview first as the user must input
all the infor (TO, CC, Subject, etc.). I can create the pdf and have all the
necessary information filled in using a macro. The problem is that it does
not filter the records to the current record. Instead, the pdf has the
reports for all records in the table. The embedded macro has the following
properties:

Action = SendObject
Arguement = Report, PrintAllOrderForms, PDF Format (*.pdf),
(e-mail address removed), , , Building Order, Please find attached an order
for a Cook Portable Warehouses. Sent from Our business. Dealer no 12345,
Yes,

Is there any way to filter this down to the current record as done with the
forms as shown in my original post?

I really appreciate any additional information.

Respectfully,
James Bennett



Arvin Meyer said:
Have a look at Stephen Lebans PDF code at:

http://www.lebans.com/reporttopdf.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


J.Bennett said:
I have a database that has three different forms. To navigate from one
form
to the other and keep the same record, I have an [Event Procedure] set up.
Additionally, to print the report for the one recored, I have another
[Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:

Private Sub printallpages_Click()

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub

I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able
to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.

I can simply do the "Preview Report" with the one item, then use the
option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....

I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.

Any help would be greatly appreciated.

James Bennett


.
 
J

J.Bennett

Thanks for the suggestion. Unfortunately, I don't think this helps. I have
no problem with creating the pdf as you can preview the report and then
simply select the emai button, it prompts you for the format (which PDF is an
option) and it attaches it to the email. This works as the "preview" is
already filtered down to one record as indicated below. However, what I am
seeking is a way to NOT have to go the preview first as the user must input
all the infor (TO, CC, Subject, etc.). I can create the pdf and have all the
necessary information filled in using a macro. The problem is that it does
not filter the records to the current record. Instead, the pdf has the
reports for all records in the table. The embedded macro has the following
properties:

Action = SendObject
Arguement = Report, PrintAllOrderForms, PDF Format (*.pdf),
(e-mail address removed), , , Building Order, Please find attached an order
for a Cook Portable Warehouses. Sent from Our business. Dealer no 12345,
Yes,

Is there any way to filter this down to the current record as done with the
forms as shown in my original post?

I really appreciate any additional information.

Respectfully,
James Bennett



Arvin Meyer said:
Have a look at Stephen Lebans PDF code at:

http://www.lebans.com/reporttopdf.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


J.Bennett said:
I have a database that has three different forms. To navigate from one
form
to the other and keep the same record, I have an [Event Procedure] set up.
Additionally, to print the report for the one recored, I have another
[Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:

Private Sub printallpages_Click()

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub

I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able
to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.

I can simply do the "Preview Report" with the one item, then use the
option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....

I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.

Any help would be greatly appreciated.

James Bennett


.
 
A

a a r o n . k e m p f

For many many many years, I stored all my variables in a single
variables table.. so when people talk about not being able to pass
around parameters?? I just laugh
 
J

J.Bennett

I guess the comment from aaron.kempf ws intended to be humorous. However, I
missed the comedy. I did figure out how to accomlish this task. Simply
preview the report and then use the DoCmd.SendObject command. The previewed
report will be what is sent. If the DoCmd.SendObject is used without the
preview, it will generate a pdf that contains the report with all records.

Just goes to show, never give up! Eventually, you can figure it out!

Thanks anyway for the assistance.

J.Bennett

a a r o n . k e m p f @ g m a i l . c o said:
For many many many years, I stored all my variables in a single
variables table.. so when people talk about not being able to pass
around parameters?? I just laugh







I have a database that has three different forms. To navigate from one form
to the other and keep the same record, I have an [Event Procedure] set up..
Additionally, to print the report for the one recored, I have another [Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:

Private Sub printallpages_Click()

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub

I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.

I can simply do the "Preview Report" with the one item, then use the option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....

I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.

Any help would be greatly appreciated.

James Bennett

.
 
Ad

Advertisements

G

Gina Whipp

J.Bennett,

Thank you for posting your solution... It is bound to assist someone else.

And while not meant to be humorous it does get a laugh now and then...
Sorry you had to run into that but just ignore.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I guess the comment from aaron.kempf ws intended to be humorous. However, I
missed the comedy. I did figure out how to accomlish this task. Simply
preview the report and then use the DoCmd.SendObject command. The previewed
report will be what is sent. If the DoCmd.SendObject is used without the
preview, it will generate a pdf that contains the report with all records.

Just goes to show, never give up! Eventually, you can figure it out!

Thanks anyway for the assistance.

J.Bennett

a a r o n . k e m p f @ g m a i l . c o said:
For many many many years, I stored all my variables in a single
variables table.. so when people talk about not being able to pass
around parameters?? I just laugh







I have a database that has three different forms. To navigate from one
form
to the other and keep the same record, I have an [Event Procedure] set
up..
Additionally, to print the report for the one recored, I have another
[Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:

Private Sub printallpages_Click()

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub

I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be
able to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but
I
have not been able to filter it down to one record.

I can simply do the "Preview Report" with the one item, then use the
option
to send as an email attachment. However, the user must put in the
email
addresses, subject, etc. Too much user input.....

I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one
record.

Any help would be greatly appreciated.

James Bennett

.
 
Ad

Advertisements

T

Tony Toews [MVP]

J.Bennett said:
I guess the comment from aaron.kempf ws intended to be humorous. However, I
missed the comedy.

As did we all. Aaron Kempf has a lengthy unsavoury history in these
newsgroups/forums. Unfortunately you were the recipient of one of his postings.
For more understandings of his temperamtn see
http://groups.google.ca/groups/prof...AClWkNjdi7eVtyYt8oOaw949h3i3SmjGmAJbX05nZ-8fQ.
Now in the search box titled "Search author's posts" put in your favourite four
letter word that you wouldn't use in your mother's presence. Oh my, 320 postings for
the f word.

(The sponsored links are highly amusing. A mixture of personals and x x x webs
sites. As well as one labelled "Cartoonify Yourself:. Now what that compa;ny is
doing with f*** as a sponsored search term is beyond my understanding.)

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
 

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