Problem with sendObject

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • craigcain
    New Member
    • Feb 2008
    • 1

    Problem with sendObject

    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,

    Craig
  • ccain
    New Member
    • Nov 2007
    • 1

    #2
    Forgot to add my code:

    Code:
    Private Sub cmdMail_Click()
    On Error GoTo Err_cmdMail_Click
        Dim stDocName As String
        stDocName = "Report Name"
        DoCmd.SendObject acSendReport, "Report Name", "Snapshot Format", , , , "Message Subject", "Message Text"
        
    Exit_cmdMail_Click:
        Exit Sub
    
    Err_cmdMail_Click:
        MsgBox Err.Description
        Resume Exit_cmdMail_Click
        
    
    
    End Sub
    On my query I have the following filter:

    Code:
    [forms]![Form Name]![Order Number]
    Craig
    Last edited by ccain; Feb 18 '08, 03:32 PM. Reason: Typo

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      Originally posted by ccain
      ...On my query I have the following filter:
      Code:
      [forms]![Form Name]![Order Number]
      Craig
      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) :
      Code:
      [YourOrderNoField] = [forms]![Form Name]![Order Number]
      The format would be the same as a SQL WHERE clause except minus the WHERE keyword itself.

      Comment

      Working...