Leading 0's issue from HTML to Access

S

strict9

Hello,

I have a spreadsheet in HTML format that contains zip codes. The zip
codes have leading zeros. When I import this data into Access (using
DoCmd.TransferText in VBA), I lose the leading zeros. The data has to
be stored in a TEXT field due to relationship restrictions.

I can find a way to force the leading zeros to be visible by using the
format 00000 in a number field, but using @@@@@ in a text field does
not cause the leading 0's to appear.

Any suggestions? Thanks in advance.
 
S

strict9

A quick note I forgot to add ... if I convert the HTML to an XLS
document, I still have the same problem. I can get the leading 0's to
be visible when I view them in Excel, but when selecting the field I
don't see a leading 0 in the "fx" box.
 
K

Klatuu

Ahh, yes. That is a problem. The best idea I can come up with is to
transfer the spreadsheet into an intermediate table, then create an append
query to format your fields as it adds the rows to your permanent table.
 

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