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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bad Formatting with Docmd.OutputTo

Status
Not open for further replies.

Hmadyson

Programmer
Mar 14, 2001
202
US
I have a query in a database which I export to excel using the Docmd.Outputto function in VBA. This query has various data types in it. Unfortunately the resulting spreadsheet always formats the number values as dates instead of as numbers. To top it off, I set the formatting in the query itself, and just previewing the query the formats are right.

Has anyone heard of this? Is there a solution? I know that I can format the number using the format function, but that will leave me with text which cannot be manipulated easily in excel as numbers. Even the general format would be better than the date format.
 
Since nobody has replied, I'll just take a stab in the dark: the problem isn't with Access, it's with Excel. You have to format the column in question as date. I would first try exporting the data, and format the offending column in excel as a date, and make sure the data looks ok.


If so, you can consider using automation (an area in which I have no expertise, you can ask others) and modify the format of your column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top