Right Align

J

Jessie

Hello.
How can I right align a text field in a table and have it
export that way in a fixed width text file?

Is this possible??

Any Help would be so appreciated.

Jessie
 
A

Allen Browne

You want to pad your field with leading spaces, assuming a fixed-width font?

Create a query into your table, and type in something like this to create a
field 40 characters wide:
PaddedField: Space(40 - Len(Nz([MyField], "")) & [MyField]

Save the query, and export that.
 
J

Jessie

Thanks!
I am getting errors with this I am not sure if I am doing
it wrong or if Maybe a little more information would help.

I have an income field that is 7 characters long. a
person's income here can range from 1 to 9999999 or it can
say None. I need to have the ending position in the fixed
width text file be the same regardles of character length.

Thanks.
Jessie
-----Original Message-----
You want to pad your field with leading spaces, assuming a fixed-width font?

Create a query into your table, and type in something like this to create a
field 40 characters wide:
PaddedField: Space(40 - Len(Nz([MyField], "")) & [MyField]

Save the query, and export that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Hello.
How can I right align a text field in a table and have it
export that way in a fixed width text file?

Is this possible??

Any Help would be so appreciated.

Jessie


.
 
J

John Spencer (MVP)

CalcField: Right(" " & [IncomeField],7) That is 7 spaces between the
quotes.

or

CalcField: Right(Space(7) & [IncomeField],7)

Allen seems to have lost a closing parenthesis.

PaddedField: Space(40 - Len(Nz([MyField], ""))) & [MyField]
Thanks!
I am getting errors with this I am not sure if I am doing
it wrong or if Maybe a little more information would help.

I have an income field that is 7 characters long. a
person's income here can range from 1 to 9999999 or it can
say None. I need to have the ending position in the fixed
width text file be the same regardles of character length.

Thanks.
Jessie
-----Original Message-----
You want to pad your field with leading spaces, assuming a fixed-width font?

Create a query into your table, and type in something like this to create a
field 40 characters wide:
PaddedField: Space(40 - Len(Nz([MyField], "")) & [MyField]

Save the query, and export that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Hello.
How can I right align a text field in a table and have it
export that way in a fixed width text file?

Is this possible??

Any Help would be so appreciated.

Jessie


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top