Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field alignment in table export

Status
Not open for further replies.

LHowell

Technical User
Jun 5, 2002
1
US
I am trying to export a table to a fixed length file. One field is a number, right aligned, and appears that way in table view. However, when I export it to a txt file, the number left aligns. How can I get it to right align...and have all the blank spaces at front of record?
 
Hi,

If your field really is a number data type, then it can't have spaces in it - spaces aren't number data type, Access is just aligning the number.

If it's a text data type, containing numbers, then you can have spaces in it.

I can't see it being worth it, but I can only see one way around this: add another text field to the table, every time you add or change the number field, then add, change the text field to be the same.
When you export the data, export the text field instead of the number field.

Sorry - maybe someone else will have a more efficient solution.

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Check your export options, I believe there is a fixed field size option.
 
i'm stuck with a similar dilemma, and was wondering how you got to the point of even exporting to a fixed width file. i got stuck with the:

DoCmd.TransferText acExportFixed, "schema", _
"tblParisLtd", "c:\dbproject\external.txt"

Unless I create the [Specification File] "schema" in Access using the File|Export the above command wont work, even though I have a schema.ini file saved in that folder.

Then I got to where you're stuck, with a field that has dollar amounts showing up as right aligned, when I want it to left align with the blank spaces in front. Creating a text field does not help.

Any help would be much appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top