By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,459 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,459 IT Pros & Developers. It's quick & easy.

Problem with sendObject

P: 1
Hi there,

I use a form for creating orders that I need to send to clients via email. For this I have a command button which attaches a report (which looks exactly the same as the form) to email in snapshot format.

My problem is that if for example I have 5 records in my table, then 5 identical versions of the report are attached to the email. This will make the attachment very large as I add more records.

I want only one copy of the report attached

To clarify: Only one file is being attached to the email but the navigation buttons are shown at the bottom where you can click left and right. The same report is shown.

Thanks in advance for any help,

Feb 18 '08 #1
Share this Question
Share on Google+
2 Replies

P: 1
Forgot to add my code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdMail_Click()
  2. On Error GoTo Err_cmdMail_Click
  3.     Dim stDocName As String
  4.     stDocName = "Report Name"
  5.     DoCmd.SendObject acSendReport, "Report Name", "Snapshot Format", , , , "Message Subject", "Message Text"
  7. Exit_cmdMail_Click:
  8.     Exit Sub
  10. Err_cmdMail_Click:
  11.     MsgBox Err.Description
  12.     Resume Exit_cmdMail_Click
  16. End Sub
On my query I have the following filter:

Expand|Select|Wrap|Line Numbers
  1. [forms]![Form Name]![Order Number]
Feb 18 '08 #2

Expert Mod 15k+
P: 31,768
...On my query I have the following filter:
Expand|Select|Wrap|Line Numbers
  1. [forms]![Form Name]![Order Number]
That's not a useful filter Craig. That's essentially saying :-
Select each record where the [Order Number] doesn't evaluate to zero.

You need (and I'm guessing the name of the field in the RecordSource of your report) :
Expand|Select|Wrap|Line Numbers
  1. [YourOrderNoField] = [forms]![Form Name]![Order Number]
The format would be the same as a SQL WHERE clause except minus the WHERE keyword itself.
Feb 22 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.