Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

Using Send Object in Access

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
Saichand
Asked:
Saichand
  • 2
  • 2
1 Solution
 
hnasrCommented:
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
 
SaichandAuthor Commented:
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
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
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
 
SaichandAuthor Commented:
thanks a lot will let you know if i have any questions
0
 
hnasrCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now