Access->Excel->e-mail

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ACMINC

Thread Starter
Joined
Mar 26, 2008
Messages
59
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.
 

OBP

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

ACMINC

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

Thanks- Ken.
 

jimr381

Jim
Joined
Jul 20, 2007
Messages
4,193
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.
 

jimr381

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

jimr381

Jim
Joined
Jul 20, 2007
Messages
4,193
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.
 

jimr381

Jim
Joined
Jul 20, 2007
Messages
4,193
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.
 

ACMINC

Thread Starter
Joined
Mar 26, 2008
Messages
59
I guess I am a bigger beginner than I though. Could you just WRITE OUT THE CODE!!!
 

OBP

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

ACMINC

Thread Starter
Joined
Mar 26, 2008
Messages
59
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.
 

OBP

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

jimr381

Jim
Joined
Jul 20, 2007
Messages
4,193
Aye you can do sub reports within the report. Did you ever try the macro out?
 

ACMINC

Thread Starter
Joined
Mar 26, 2008
Messages
59
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?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top