Solved

ExportText number justification

Posted on 2004-04-13
10
308 Views
Last Modified: 2012-05-04
I am exporting a data file where it seems no matter what I do, the justification is to the left.  the number is a double/fixed/2 decimal in table.  What is the deal?

Thanks

Tony
0
Comment
Question by:amangia
  • 5
  • 4
10 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 10816091
All numbers will be left justified as the lading zero's will be suppressed.
Did you try to append spaces to the left to get a fixed width like:

select right("          " & [numberfield],10) as FixedNumberField, ...

Nic;o)
0
 
LVL 77

Expert Comment

by:peter57r
ID: 10816095
Hello amangia,

What format are you exporting to?


Pete
0
 

Author Comment

by:amangia
ID: 10816248
I am exporting to a text file.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 54

Expert Comment

by:nico5038
ID: 10816389
Did you try to export into a fixed format ?

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816408
I am exporting to a fixed format and am using an export spec.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10816422
Hmm, strange as it looks like the number field is seen as text....
Did you try my uggly workaround ?

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816506
To be honest, I don't know WHERE to put the workaround.  I am exporting out of a table.  I have a form with a button.  The Event Procedure behind it is:
DoCmd.TransferText acExportFixed, "FoodBuy Export Specification", "foodbuy1", "c:\RBF01" & " " & Format(Now(), "mm - yy") & ".txt", False.

Where abouts would I put the ugly little booger?
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 500 total points
ID: 10816571
The "foodbuy1" will be present under the queries in the database window.
Open the query in design mode and select the field.
Now change the field in the cell like:
FixedNumberField:right("          " & [numberfield],10)

(The 10 spaces between the quotes are arbitrary and can be "expanded" to have the number of characters you need the field to be displayed) Just make sure "numberfield" is changed into the name of the field that needs justification.

Nic;o)
0
 

Author Comment

by:amangia
ID: 10816685
I did that, but still to no avail.  So...I got to thinking and changed the field type to TEXT.  Bingo!  Works now.  

Thanks Nic
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10816791
Glad it works, success with the application !

Nic;o)
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question