Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email excel file in access similar -thread181-877231

Status
Not open for further replies.

Super2

Programmer
Mar 16, 2006
2
US
thread181-877231

I can email using sendobject. I email a excel file but I don't want to email it if it is empty. I either want to not email it at all or email a "no data" message in the email subject line if it is empty. How can I do this?
 

If you export a query to excel from access, you could check if the query exported, has no records! You 'll have to use VBA for this
 
I am acutally sending a query as an excel file.I guess I should be checking for the query being empty and then deciding what email to send (file or message). I am not sure how to check the query for being empty before sending email.
 
how to check the query for being empty
One way (VBA code):
If DCount("*", "yourQueryName") = 0 Then
...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top