Recurring Invoices

S

Scottie

I have designed a database for a taxi co. I need to add driver invoicing to
it, but I am a bit puzzled as to how to do it correctly. They need a driver
receipt for payments made. Each driver keeps the vehicles for an indefinite
period of time..being charged a weekly/ daily rate. The weekly rate is due
every Monday. Problem is, there are 30-50 active drivers that would need
invoices created every monday. Is there a way to automatically create an
invoice for all active drivers? A bit of sample code could help me out a
lot, thanks
 
A

Andreas

All you need to do is to create a report, add a grouping header for the
driver and set a page break for that grouping header.
As long as the query for the report filters the data correctly for
active drivers only, this should do everything you need.

Regards,
Andreas
 
S

Scott McDaniel

How you would do this depends on how your tables are setup. Do you have a
field/column that indicates which drivers are Active? If so, you could use a
loop to iterate all active drivers:

dim rst as DAO.Recordset

Set rst = CurrentDB.OpenRecordset("SELECT lngDriverID FROM tblDrivers WHERE
blnActive=True")

Do Until rst.EOF
DoCmd.OpenReport "YourInvoice",,,,"lngDriverID=" & rst("lngDriverID")
rst.MoveNext
Loop

You'd have to change the names of your tables/fields/reports etc but this
is, in general, how you would go about doing this. You'd also have to have
an Invoice report built that would correctly query your other tables to
build the invoice. Again, without some examination of your existing table
structure it'd be hard to advise you further.
 
Top