By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,208 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,208 IT Pros & Developers. It's quick & easy.

If query has not records -"no records found" to be output in query out/report

P: n/a
I am currently running a marco that run a query and emails the results
as an attachment in excel format. If the query has no records, I would
like to email "no records found" in the first cell in the excel
attachment. I have a feeling that this needs to be done in VB, but I
don't know that much about VB. Would using a report instead be a
better and easier way of doing this?

Aug 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I would open the query in VBA and do a recordcount. If recordcount >
0, send the email. Otherwise, send "No records found".

scottmach...@cox.net wrote:
I am currently running a marco that run a query and emails the results
as an attachment in excel format. If the query has no records, I would
like to email "no records found" in the first cell in the excel
attachment. I have a feeling that this needs to be done in VB, but I
don't know that much about VB. Would using a report instead be a
better and easier way of doing this?
Aug 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.