Export table to txt file

C

CindyK

I am using the docmd.transfertext function to export a table to a
comma-delimited text file. When doing this, my number field (formatted as
double, fixed, 6 decimal) does not export the correct number of decimal
places.

Does anyone know how I can force the file to export with the 6 decimal places?

Thanks!

Cindy
 
K

Ken Snell [MVP]

Build a query based on the table. Use a calculated field instead of the
original field that needs to have the desired formatting:

MyNumber: Format([FieldName], "0.000000")

Export the query instead of the table.
 
K

kpjamro

Ken Snell [MVP]wrote
"]Build a query based on the table. Use a calculated field instead o
the
 
K

Ken Snell [MVP]

Try putting the field name inside [ ] characters.
Format(PVQSelected.[VALUE],"0.000") AS [VALUE].......

Do not use Value as the name of a table's or query's field. It and many
other
words are reserved words in ACCESS, and can create serious confusion for
ACCESS and Jet. See these Knowledge Base articles for more information:

List of reserved words in Access 2002 and Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

List of Microsoft Jet 4.0 reserved words
http://support.microsoft.com/?id=321266

Special characters that you must avoid when you work with Access
databases
http://support.microsoft.com/?id=826763


--

Ken Snell
<MS ACCESS MVP>

kpjamro said:
Ken Snell [MVP]wrote:
"]Build a query based on the table. Use a calculated field instead of
the
original field that needs to have the desired formatting:

MyNumber: Format([FieldName], "0.000000")

Export the query instead of the table.
--
Ken Snell
<MS ACCESS MVP>

I am doing this and it still does not work
(I get 2 decimal places always, I want 3)

my query ....Format(PVQSelected.VALUE,"0.000") AS [VALUE].......

Thanks
 
K

kpjamro

Ken Snell [MVP]wrote
"]Build a query based on the table. Use a calculated field instead o
the
 

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