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

How not to output when OutputTo function returns no records?

P: 44
Hi..

I have a question regarding the DoCmd.OutputTo function.

I am automating some email scheduling with file attachments generated from OutPutTo function.

However, some of the daily OutPutTo functions do not necessarily return any records. For such cases, my program is still attaching empty files (with no records) in the email.

How can my program check that the OutputTo function did not return any records?

Much appreciated if anyone could advise.

Cheers!
Clarence
Oct 16 '07 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
I would think you need to check your table or query to see whether it contains any records before carrying out the operation. DCount() should do the job!

Expand|Select|Wrap|Line Numbers
  1. If DCount("*", "YourTable") > 0 Then
  2.   MsgBox "Carry out your OutPutTo Operation"
  3. Else
  4.   MsgBox "Don't carry out your OutPutTo Operation"
  5. End If
  6.  
Linq ;0)>
Oct 16 '07 #2

P: 44
Hi Linq,

Thank you very much for your assistance.

Have a great day!

Clarence



I would think you need to check your table or query to see whether it contains any records before carrying out the operation. DCount() should do the job!

Expand|Select|Wrap|Line Numbers
  1. If DCount("*", "YourTable") > 0 Then
  2.   MsgBox "Carry out your OutPutTo Operation"
  3. Else
  4.   MsgBox "Don't carry out your OutPutTo Operation"
  5. End If
  6.  
Linq ;0)>
Oct 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.