Keep leading zeros in txt export

G

Guest

We have a table that gets updated and the results are exported to a
fixed-width text file (and then uploaded to an external company).

The table has an autonumber field with format set to 000000000. When we
view the table, this gives us the proper 9-digit number requested by the
external company (ie 000002342), however we've discovered that when we export
the table to a fixed-width txt file, the autonumber field loses its leading
zeros.

How do we maintain these leading zeros? Thanks.
 
R

Rick Brandt

JT9090 said:
We have a table that gets updated and the results are exported to a
fixed-width text file (and then uploaded to an external company).

The table has an autonumber field with format set to 000000000. When
we view the table, this gives us the proper 9-digit number requested
by the external company (ie 000002342), however we've discovered that
when we export the table to a fixed-width txt file, the autonumber
field loses its leading zeros.

How do we maintain these leading zeros? Thanks.

Formatting properties (of any type) are strictly for dislay *in Access*.
Exporting exports the raw underlying data in a format you have no control
over.

What you do is create a query based on your table and export that instead.
In the query you use the Format() function rather than the format property.
That actually causes the output to be a string in the format you specify
rather than just being displayed that way.
 

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