Leading zeros using macro to load multiple .csv files

G

Guest

I am using an access macro to load multiple .csv files into Access 2000.
However, I am loosing the leading zeros on employee numbers. I am using the
TransferText action to import the files. How can I prevent dropping those
leading zeros?

When I import the .csv files individually, the leading zeros appear.
 
J

John Nurick

Hi JP,

This is one of the quirks of the import routines.

In some circumstances, a field that is imported as text if you use
File|Get External data and the text import wizard is imported as numeric
if you use the TransferText action.

You can either accept the data as numeric and use the Format property of
controls on forms and reports to display it with leading zeros (e.g. a
format property set to "0000" for four digits); or else ensure that it's
imported as text.

To do the latter, you need to create an import specification. Import the
file once manually, and when you've made all the settings in the text
import wizard click the Advanced... button and save the current settings
as a specification. Then include the name of this specification in the
macro.
 

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