Using VBA to format Excel Import

G

Guest

I need to import an Excel spreadsheet (that is a download report from another
system) into my database. There is one TEXT field in the Excel database that
contains some blank spaces in front of the field. The field may contain a
mixture of numbers and letters and sometimes has a '0' as the first charater.
Example of data: '0910', '810', '678WX', '0001'. The spaces appear in the
table when I do a 'Transfer Spreadsheet' or a "Select statement' and the '0'
are eliminated when I set the field as a numeric field'

..... How can I use VBA to import the Excel data into my Access table WITHOUT
the preceding invisible characters?
 
J

Joe

Since you already have the data ina table using the transfer spreadsheet,
you could just us the LTrim, RTrim, and/or Trim functions in an update query
to remove leading and trailing spaces.
 

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