Solved

Using Send Object in Access

Posted on 2011-02-24
5
371 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

947 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now