Send past due

  • Thread starter Thread starter Ken Ivins
  • Start date Start date
K

Ken Ivins

I want to send a list of past due customers via email to the respected sales
people using code. Each salesperson will only receive their list of people.
I assume I create a report and use SendObject to send this snap shot. I can
do this one at a time but to send them all is what has me baffled. I assume
I use some kind of loop to create a new report based on a different
salesperson. Also if a sales person does not have anyone past due then no
email will be sent.

I have a customer table, a billing table, a payment table and a salesman
table (that has their name and email, etc.).

Thanks,
Ken
 
Create an aggregate query on your salesman table and whichever one has the due
date in it with 'WHERE DueDate < Now - 1' (or similar) and 'HAVING Count(*) >
0' constraints. You can then open a recordset on this query, step through the
records and run the report for each salesman returned. Don't forget to check
that you have at least one record before you try to start the loop in case
everyone has paid up on time!
 
John,

Thanks, That's a big help.

Ken


John Smith said:
Create an aggregate query on your salesman table and whichever one has the due
date in it with 'WHERE DueDate < Now - 1' (or similar) and 'HAVING Count(*) >
0' constraints. You can then open a recordset on this query, step through the
records and run the report for each salesman returned. Don't forget to check
that you have at least one record before you try to start the loop in case
everyone has paid up on time!
 
Back
Top