Solved

Using Send Object in Access

Posted on 2011-02-24
5
374 Views
Last Modified: 2012-05-11
Hi Experts,

i am using the send object action to convert a query into excel and send it via email. But now i have to add a few more line as headers in the excel spreadsheet that is being sent.

Could you please let me know how to add notes in the spreadsheet before its being sent.

Thanks,
Sai.
0
Comment
Question by:Saichand
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 34975412
Try this:
Table a(f1, f2, f3, aid)

Add the notes in the query and continue your work.

Select f1, f2, f3, aid from a
UNION
Select top 1 "note1", "note2", "note3", "note4" from a
0
 

Author Comment

by:Saichand
ID: 34989025
can you please show how you are doing iit n a access database?

i have attached a excel template where the output from the query should be added in line 4
test.xls
0
 
LVL 21
ID: 34989813
Since you are using SendObject this limits what you can do a lot.

hnasr's suggestion is using a Union query to add data to you current query. The idea si the you wuill add uyour comments as reco9ds in teh query,. This wil allow you to continue to use teh SendObject method.

 If the comments must go into specific cells in the worksheet then  you will probably want to use Excel automation. You could collect the additional information in Access then export all the data to the Excel file.

See: Export to Excel

0
 

Author Comment

by:Saichand
ID: 34993342
thanks a lot will let you know if i have any questions
0
 
LVL 30

Accepted Solution

by:
hnasr earned 500 total points
ID: 34993733
I assumed that you allready using sendobject to send the query to excel.

Assume the query is toExcel_q. Query sql:
Select f1, f2, f3, aid from a

Now you add few lines and then email.

The idea is to add the notes to the query, then sendobject the query to excel.
The query toExcel_q's sql is:

Select f1, f2, f3, aid from a
UNION
Select top 1 "note11", "note12", "note13", "note14" from a
UNION
Select top 1 "note21", "note22", "note23", "note24" from a  

I did not check Saichand's comment. Try it.

0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question