Hello,



I need my form have an email button that will send an email with the results of a query.

What I'd LIKE to do is embed the query results directly in the email, but I have not been able to come across a solution.

What I've done instead is to set the results of the query as an attachment to the email using SendObject().



The problem is it doesn't work prefectly every time.
  • The first time I open the email and send, and everything is great - the attachment is there, all my body text is there, etc.
  • Then, to cross my t's and dot my i's, I open the email a second time and do not send it.
  • Then I open the email a third time only to get an error that says "Query must have at least one destination field" - and then I check the query only find out that it's gone! My query deleted itself.
Anyone know what the deal is? Or, can anyone point me in the right direction to add the query results directly to the email?

My Query (named qry_EmailMessage):
SELECT DateTimeStamp AS Time, CommentBy AS By, CommentType AS Type, Comment AS Comment
FROM tblComments
WHERE (((tblComments.ID)=Forms!frmData_View!HoldEventID) );
My SendObject:
DoCmd.SendObject acSendQuery, "qry_EmailMessage", , Recipient, , , " ***** Fire/Emergency Notification *****", Details
Edit Time:

Did a compact and repair a few times and now it seems to be working. (Sure, after I banged my head on the desk for a few hours )

Anyway, if possible, I would still rather get the query to display in the email body instead of as an attachment. Anyone have any clue?

Edit again:

And back to not working...