Solved

Using Send Object in Access

Posted on 2011-02-24
5
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

631 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