Kamis, 21 November 2013

[MS_AccessPros] Output query to multiple Excel Worksheets

 

I currently have a query that I am outputting to an Excel File as follows:

DoCmd.OutputTo acOutputQuery, "mltc1a", acFormatXLS,, True

 

It works fine.

 

The query looks like this:

SELECT  Patient.[last name] & "," & Patient.[first name] AS [Registrants Name], insurance.iname AS MLTC, Patient.[start date] AS [Start Date], Patient.[end date] AS [End Date], Patient.recertdate AS [Recertification Date]
FROM (Patient LEFT JOIN shift ON Patient.[preferred shift] = shift.[Shift #]) INNER JOIN insurance ON Patient.insrcd = insurance.insrcd
WHERE ...(conditions)
ORDER BY Patient.[last name], Patient.[first name], Patient.mi, Patient.[patient id];

I would like to add a seperate worksheet for each insurance code/MLTC to this Excel file. So I can have a worksheet for each MLTC, lisiting all the names that belong to it. I would also like the name of the worksheet to be the MLTC name.

 

How can I do this?.

 

Thanks for all your help.

 

Sarah

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar