|
-
Dec 13th, 2005, 04:18 PM
#1
Thread Starter
Member
Export Access Query To Multiple Excel Worsheets in 1 Workbook, HELP!
Hi Folks,
I want to export a query that I have to an excel document. That is the easy part though. My client also wants it exported to where each particular buildings schedule is on it's own worksheet within the 1 workbook. Example Of what I'm working with is below
Code:
Select tblCalendar.date, tblCalendar.Event, tblCalendar.time, tblCalendar.Building from tblCalendar Where tblCalendar.date between #12/12/2005# And #12/25/2005#
There can be any number of buildings that are scheduled for, so the number of worksheets (tabs) in the workbook needs to be variable and dicated by the result set.
Essentially he wants each buildings schedule (tblCalendar.Building) to be on it's own worksheet within the one workbook. Does anyone know how to do this? My search has been unsuccessful as of yet. Any input is GREATLY appreciated!
-
Dec 13th, 2005, 07:42 PM
#2
Re: Export Access Query To Multiple Excel Worsheets in 1 Workbook, HELP!
Moved to Office Development
One way to do it would be to order the data, by simply extending the SQL like this (I assumed the order you would want for the other fields):
Select tblCalendar.date, tblCalendar.Event, tblCalendar.time, tblCalendar.Building from tblCalendar Where tblCalendar.date between #12/12/2005# And #12/25/2005# Order By tblCalendar.Building, tblCalendar.date, tblCalendar.time, tblCalendar.Event
You can then read this with your code, and if the Building is different to the previous, create a new sheet for it - and put all data on it until Building changes again.
-
Dec 14th, 2005, 08:24 AM
#3
Thread Starter
Member
Re: Export Access Query To Multiple Excel Worsheets in 1 Workbook, HELP!
Do you have some code that might help guide me on my quest?
-
Dec 14th, 2005, 08:33 AM
#4
Re: Export Access Query To Multiple Excel Worsheets in 1 Workbook, HELP!
What code do you have so far?
It's much easier for me to add to your code than write it all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|