Code for Exporting to Text

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
 
A

Albert D. Kallal

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])
 
S

Sandy

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
 

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