Exporting to a text file

J

Jasmine

I have a table that I am trying to export into a fixed
width text file. During the export process I created the
Spec file to make my fields the lengths I need them to
be. It is working good on all but three fields. These
three fields are text fields with numbers in them. Some
have leading zeros. When I export the file, it drops my
leading zeros. Any help to prevent this from happeing
would be appreciated. Thanks!!!
 
J

John Nurick

Hi Jasmine,

Use a calculated field in a query to add the leading zeros, and then
export the query. Something like

fXX: Right("000000"& Format([XX],"0"),6)

where XX is the name of the field.
 
R

Roger Carlson

On my website, see sig below, is a small sample database called
"ExportFormattedFixed.mdb" which illustrates how to do this.
 
J

Julie Lee

Jasmine,
To fix your problem do the following:
- open your table
- go to the table field you are having troubles with
- in the general tab go to field size, change field size
to a long integer
- in the general tab go to format, format zero values the
size of your desired field length i.e. if you want 5675
then format zero's like this 0000.
 

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