Count Distinct excel output

n90

Registered User.
Local time
Today, 00:01
Joined
Dec 6, 2013
Messages
18
I have a query that contains Invoices(usually 2 line items per invoice) Taxable and NonTaxable. I need to able to basically export it to excel on multiple worksheets when the Amount of unique invoice number reaches 15.

From all my scouring on the internet I can't find anything with this criteria.

Any ideas if this can be done?
 
This can be done... if you just wanted to post the results of the query to two worksheets within a spreadsheet, copy the query twice, name one whatever you want to call the first worksheet and name the second query whatever you want to call the second worksheet... then run this:

DoCmd.TransferSpreadsheet 1, 8, "QUERY1", "C:YOUR_PATH\EXCEL_REPORT_NAME.xls", True
DoCmd.TransferSpreadsheet 1, 8, "QUERY2", "C:YOUR_PATH\EXCEL_REPORT_NAME.xls", True
 
This can be done... if you just wanted to post the results of the query to two worksheets within a spreadsheet, copy the query twice, name one whatever you want to call the first worksheet and name the second query whatever you want to call the second worksheet... then run this:

DoCmd.TransferSpreadsheet 1, 8, "QUERY1", "C:YOUR_PATH\EXCEL_REPORT_NAME.xls", True
DoCmd.TransferSpreadsheet 1, 8, "QUERY2", "C:YOUR_PATH\EXCEL_REPORT_NAME.xls", True

No thats not what I'm looking for, well sort of.

So the query can be for instance 160 line items, 50 unique invoice numbers, and then each Invoice can have 1 or 2 line items depending on if it has taxable line item.

I need to be able to export it to excel and a new worksheet every time the output per worksheet hits 15 Unique invoices however that doesn't mean 30 rows because again some invoices do have the taxable line item and some don't. So one sheet can have 25 line items, next 20, 27, and so on until it exports a total of the query in this case 160 line items
 

Users who are viewing this thread

Back
Top Bottom