Solved

ExportText number justification

Posted on 2004-04-13
10
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

710 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