Maintain data format when exporting to Excel

P

PC

Hi,

How can I maintain the data format of a field when I export a report to
excel. I have a couple of fields that are denoted as "text" format but
export as numerical to excel. For example, the text "04/01-5" appears in
excel as something like "38443". How can I force access to export the field
exactly as it appears?

Thanks
 
V

Van T. Dinh

It looks like Excel interprets your String as a date value since 38443 is
the numeric value of the date 01/Apr/2005.

If the Field in your Table is actually of Text type, this interpretation is
done by Excel and I would suggest asking in an Excel newsgroup on how to
prevent this automatic interpretation.
 
P

Pieter Wijnen

You can either export the data using Docmd.transferDatabase on the
underlying Query
-- Or --
Prefix the Data Field in your report with a ' (apostrophe) to force excel to
treat it as text...
ie
Controlsource="'" & myDataField

HTH

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top