Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting to Excel Automatically incorrectly formats some data

Status
Not open for further replies.

JTregear

Technical User
Oct 11, 2002
24
0
0
GB
I have a number of Access reports which display data in the format

#.#.#

When I export any such Access report to Excel, Excel thinks that such information is a time, and automatically converts it a time and then displays the information as a number, so for example, a field which was originally display as 7.2.5 in the Access report, will get displayed as 0.293113426
in the Excel report.

Has anyone got a suggestion on how I can avoid such problems?
 
Have you tried preformating (before import) the column in Excel for what the data type is supposed to be??
 
The report is output to Excel by using a command such as:

DoCmd.OutputTo acReport, stDocName, acFormatXLS

The Excel spreadsheet is therefore created when exporting to Excel, so unfortunately it cannot be pre-formatted.
 
pre format your data from the table or query...

use format([fldNme], "Medium Date") in the query the report is based on...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top