Exporting to a text file

  • Thread starter Thread starter Jasmine
  • Start date Start date
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!!!
 
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.
 
On my website, see sig below, is a small sample database called
"ExportFormattedFixed.mdb" which illustrates how to do this.
 
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.
 
Back
Top