Code for Exporting to Text

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

Hello!

I am exporting a table to a text file and have been asked
to right-align the columns and use whole numbers instead
of decimal numbers.

I can't find anything in the creating specifications
options relating to either of these two things.

Does anyone have any suggestions?

Sandy
 
The best approach is to build a query, and then export that.

In all places in ms-access, you can use a query in place of a table.

So, for those right aligned columns, you could convert the decimal (real)
number to a long number.

In query builder, in place of the decimal field, you could use;


lngFieldName: clng([FieldName])

The above would convert the value to a long integer, and thus the decimal
part would be removed. It is not clear how you want the rounding to go. If
you want to remove the decimal part with no rounding, then try
int([FieldName])
 
Dear Albert:

Thanks for your reply!

I have two text columns that need to be right-aligned.
How do I do that? I tried long integers, but they left-
align the columns . . . but they do get rid of the
decimals.

Also, I am supposed to do all of this in code. Do you
have any suggestions on that?

Thanks again for responding.

Sandy
 
Back
Top