Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2004, 06:45 AM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Exporting Query Results to Excel File

Hello all,

I'm curious as to how to export a query to an excel worksheet.
I'm updating an old scheduling program we use to take a query (which grabs everyone's work schedules for the next month) and display it in a format similar to:

Name Day

Name1 D1

(For clarification, D1 is a code for "Daylight, 1 shift". Its the terminology we use)

We have a report already generated, however, when we export the report to excel, the formatting gets all FUBAR'd.

So my superior wants me to directly export the query results to an excel file, hoping that will preserve formatting better. I'm told there's two ways to do this -- one is to just dump data into an excel file, while the other involves moving from cell to cell inserting values. I'm interested in both methods, as I'm not sure which would work best and might have to try both.

Does anyone have a good starting point of code I could play with?
 
Old August 23rd, 2004, 08:58 AM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, I'm also interested in updating the database off the spreadsheet as well. Anyone got code for importing as well?

Thanks
 
Old October 7th, 2004, 05:26 PM
Authorized User
 
Join Date: Oct 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure of the first of your two questions, but you can
run a DoCmd.TransferSpreadsheet command to import (or export)
a spreadsheet. The details can be found in the online help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting Query Data From Access to Excel JimInSouthernCal Access VBA 3 December 21st, 2007 08:34 AM
Chapter 16: Exporting query data to Excel 5tr0ud BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 0 October 9th, 2007 04:23 PM
exporting pdf search plugin results to .txt file solos Pro Visual Basic 2005 0 August 6th, 2007 12:01 PM
Exporting data into Excel file from SSIS atulmar Reporting Services 0 November 21st, 2006 09:35 AM
Exporting listview data to excel file dotnetprogrammer VS.NET 2002/2003 2 May 10th, 2005 08:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.