• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

ExportText number justification

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
amangia
Asked:
amangia
  • 5
  • 4
1 Solution
 
nico5038Commented:
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
 
peter57rCommented:
Hello amangia,

What format are you exporting to?


Pete
0
 
amangiaAuthor Commented:
I am exporting to a text file.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
nico5038Commented:
Did you try to export into a fixed format ?

Nic;o)
0
 
amangiaAuthor Commented:
I am exporting to a fixed format and am using an export spec.
0
 
nico5038Commented:
Hmm, strange as it looks like the number field is seen as text....
Did you try my uggly workaround ?

Nic;o)
0
 
amangiaAuthor Commented:
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
 
nico5038Commented:
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
 
amangiaAuthor Commented:
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
 
nico5038Commented:
Glad it works, success with the application !

Nic;o)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now