1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access->Excel->e-mail

Discussion in 'Business Applications' started by ACMINC, Mar 26, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. ACMINC

    ACMINC Thread Starter

    Joined:
    Mar 26, 2008
    Messages:
    58
    I would like to see the Access 2003 code that would give an Access program the ability to copy/transfer/change an Access table into a EXCEL speadsheet, and then e-mail that speadsheet to someone.

    Thanks- Ken.
     
  2. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    I did it via a macro and it worked fairly seamlessly.
     
  3. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Jim, did the macro send it as an attachment?
    If yes, could you post a copy please?
     
  4. ACMINC

    ACMINC Thread Starter

    Joined:
    Mar 26, 2008
    Messages:
    58
    What am I doing wrong. I can not seem to find the "marco" you stated worked fairly seamlessly.

    Thanks- Ken.
     
  5. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    You do not find it you create it. ;) Yes it did a transferdata then attached it to an e-mail that was sent out. I will look into it again. I just have to make a little time to recreate it.
     
  6. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    I found the database. I used the sendobject action within the macro to transfer the query into a new e-mail as an attachment.
     
  7. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Jim, so it was the query that you sent, not an Excel sheet?
     
  8. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    It exported the query into an Excel spreadsheet. When you setup the action it asks you what type of file you want to send it as. It is very easy to use.
     
  9. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    Sorry the last part of the last post did not sound right. The only drawback I have seen is that it will not take an e-mail address from field within the DB.
     
  10. ACMINC

    ACMINC Thread Starter

    Joined:
    Mar 26, 2008
    Messages:
    58
    I guess I am a bigger beginner than I though. Could you just WRITE OUT THE CODE!!!
     
  11. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    You do not write the "Code", you create a Macro using the macro wizard and selection tools.
    Have you looked at Macros?
     
  12. ACMINC

    ACMINC Thread Starter

    Joined:
    Mar 26, 2008
    Messages:
    58
    I finally have a handle on docmd.sendobject to send e-mail. Next problem. Every time I use the line:

    DoCmd.SendObject acSendReport, "rptInvoice", "Snapshot Format", strName, , , strMessage, , False

    my customer receives a e-mail with rptInvoice.snp What do you do if you want to send him multiiple invoices? I tried:

    strDocName = "D:\Invoice" & strInvoiceUID & ".snp"
    DoCmd.OutputTo acOutputReport, "rptInvoice, "Snapshot Format", strDocName
    DoCmd.SendObject acReport, strDocName, "Snapshot Format", strName, , , strMessage, , False

    But acReport is wrong. What is the correct way to "sendobject" and its already a .snp?

    Thanks- Ken.
     
  13. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Put the multiple Invoices on one Report and send them the SNP of that report.
     
  14. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    Aye you can do sub reports within the report. Did you ever try the macro out?
     
  15. ACMINC

    ACMINC Thread Starter

    Joined:
    Mar 26, 2008
    Messages:
    58
    Thats not going to work. Let me explain further. My customer wants to e-mail his customers with an invoice each and every time one is created. He doesn't want to batch all of them at the end of the day. The problem is that the command:

    DoCmd.SendObject acReport, strDocName, "Snapshot Format", strName, , , strMessage, , False

    Only allows you to e-mail a form,report,etc. What do you use when you already have the report saved on your harddrive as a .snp?
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/697234

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice