Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ExportText number justification

Posted on 2004-04-13
10
Medium Priority
?
324 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

824 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