Page 1 of 5 12345 LastLast
Results 1 to 15 of 66
  1. #1
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246

    Sending .pdf in Outlook

    Click image for larger version. 

Name:	Macro Email.png 
Views:	17 
Size:	119.2 KB 
ID:	12039

    I am just trying to email customer just a copy of his invoice and when I looked at the attachment it brought up all the invoices for every customer in our database. I changed it to print up Form and now it wont attach anything in email.



    Please advise to what I am doing wrong

    TIA!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Somehow the report needs to filter itself to the record on the form. A parameter query is one way, this is another:

    http://www.granite.ab.ca/access/emai...recipients.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Ok unfortunately that link has me all confused. Can you advise to where I would put this filter? I have the form in design view and looking under the properties of this field I only see FilterLookup.

    I look under CustomerExtended Query and still not sure what to put in there...can you give me an example? the examples that is at that link unfortunately doesnt help me as that isnt telling me where to go to other then need to create Filter too.

    I need it to email it out in PDF...got that working fine in the Macro...all I want to do is email only ONE invoice that is attached to that customers order...not everyone elses invoice too..is that part of the Macro somewhere that I am missing? Is there a VBA Code for this that I am missing?

    Sorry for so many questions just getting frustrated here :-(

    TIA!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    From the link: "Therefore you must change the filter or where clause yourself in the reports OnOpen event."

    If you want to use the query, you'd put a criteria pointing to the form under the appropriate field(s).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    What version of Access has OnOpen in the Events? Because in Access2010 I dont see it...maybe that is why I am confused here?

    Click image for larger version. 

Name:	Event Properties.jpg 
Views:	13 
Size:	164.2 KB 
ID:	12040

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You're looking at the properties of a textbox. You want the properties of the report. You want to email a report, not a form; you have a lot more control over the formatting in a report.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    in the properties under the report under On Open (Embedded Macro) but when I open that its blank. Now what?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The method I posted is VBA, which would go here:

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Me.Filter = "ShipmentsID=" & Forms![Select Load List]![LoadID]
    Me.FilterOn = True


    Now here is the qestion...as I am not sure of the VBA for my issue so treat me like i am huge dummy when it comes to VBA Coding:

    You said to do it where it says OnOpen
    Under OnOpen is (Embedded Macro) with nothing in it.
    Do I put it somewhere else or get rid of the (Embedded Macro) and put it OnOpen event?
    Secondly - I dont think that code above will work for me as I am not sure what a "ShipmentsID=" is nor do I know what to type in after that.

    My report name is Invoice

    Can you help me out and tell me the correct way to type this code? What do I change in the above code that will work for me?

  10. #10
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    and just FYI...I am using a Template and just entering in all the pertanent info (i.e. customers, products, supplies, employees) in the tables prvided and using the predetermined reports as well as it seems my VBA knowledge really sucks.

  11. #11
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    ok this is what i got so far...

    Private Sub Report_DblClick(Cancel As Integer)
    Me.Filter = "Invoice=" & Forms! (what do i select here?) ! (what do i do here?)
    End Sub

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    I open filtered reports using WHERE argument of DoCmd.OpenReport. I don't use macros so the VBA is like:

    DoCmd.OpenReport "Invoice", acViewPreview, , "ShipmentsID=" & Me.LoadID
    DoCmd.SendObject acSendReport, , acFormatPDF, "email address", , , "Invoice", "email body text"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Hi June!

    Ok here is the problem with that...

    DoCmd.OpenReport "Invoice", acViewPreview, , "ShipmentsID=" & Me.LoadID
    DoCmd.SendObject acSendReport, , acFormatPDF, "email address", , , "Invoice", "email body text"

    Where its highlited in RED is throwing me off...
    The only thing I have on this Report is Order ID and Product ID that says ID in the name Do I change what is in RED to those?

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Use whatever criteria gets the report to open with desired recordset. If that is OrderID then use OrderID. Actually, I would have thought there would be an InvoiceID because you are printing an invoice. But since I don't know your data structure, I can't be specific. I was only following criteria examples in previous posts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Ok lets start all over here because it seems that anytime I ask for help its becoming a huge project to get the answers as I need them. And each time I think I explain what it is that I need help with with...but since I am not as knowledgable as you all it would help if you are not sure what it is that I am trying to do to ask me the questions in return that is needed to get the help here that I need ...so maybe if I explain exactly what I am trying to do and when I want it done then maybe we can get this worked out together here :-)

    Now first off...I am running Access 2010 - so sending me links for any version prior is not going to help me...wasted alot of time with that earlier. And I would have thought that it says which one i am running under my name I would be able to get support for my version :-))

    Here is what I am trying to do...

    Customer calls in an wants to place an Quote/Order for the product. Now before we can submit it as an order they MUST have a Quote for approval. Now I bring up the Quote/Order Form. Sales puts in customers info. Then they select the products that the Customer wants. After which then the Sales can double click on the Customers email on trhe Quote/Order Form to which it will bring up Quote/Invoice as a PDF and attach itself to email to the customer.

    Now here is what is on the Quote/Invoice that we call it but in reports we call it "Invoice"

    and now that I have put in the VBA Codes that you all have suggest...now I cant even get the Invoice up at all. I am getting RUN TIME ERRPR 2427: You have entered an expression that has no value.

    I have tried the following as suggested:
    DoCmd.OpenReport "Invoice", acViewNormal, , "Product_ID" & Me.Order_ID
    DoCmd.SendObject acSendReport, , acFormatPDF, "email address", , , "Invoice", "email body text"

    Then tried the following:
    DoCmd.OpenReport "Invoice", acViewNormal, , "Order_ID" & Me.Product_ID
    DoCmd.SendObject acSendReport, , acFormatPDF, "email address", , , "Invoice", "email body text"

    Now I didnt name these things...Northwinds Trader did. I thought it could be seen in the Pics I posted above..

    Where as before I was able to get the Invoice, I was able to email and attach PDF thru the Macro that I created but unfortunately I was sending EVERY Invoice to one customer.

    I know that there must be somewhere that says to ONLY send for that customer THAT Order somewhere in the program somewhere...but I am stumped on where and how to put it to get this work.

    I really mean this from the bottom of my heart and not being mean or ficisious when saying this. You all are doing your best to help me..adn you have shown great patience in not kicking me off here..yet!! lol but I know I have said several times here in the forums...Treat me as if I NEVER touched Access before and guide with me kids hands thru this process please. If you tell me to put something somewhere please be a little more detailed..and please make sure that we are talking about the same version of Access and not send me to things that work for 2003 and 2007 but not compaitable with 2010. And if your not sure what I am talking about...please ask me the right questions so I can get to you what you need to know to help me.

    So what I said above..does this help you understand what it is that I need help with? and if not what else do you need to know to assist me with this..

    Thanks again for all your help and support in this

    Stephanie

Page 1 of 5 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sending HTML files via Access to Outlook
    By Yann63 in forum Programming
    Replies: 4
    Last Post: 02-13-2014, 05:34 PM
  2. sending data into an email body - outlook
    By webisti in forum Access
    Replies: 6
    Last Post: 02-15-2012, 07:05 AM
  3. Sending Outlook E-mail - Run-time error '429'
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 03-01-2011, 09:30 AM
  4. Replies: 1
    Last Post: 03-09-2006, 01:50 PM
  5. Sending email via Outlook (and Exchange2003) from Access2003
    By Larry Elfenbein in forum Programming
    Replies: 0
    Last Post: 11-15-2005, 09:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums