borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Sometimes Excell does not show anything)Next Topic (Any Free VBA Guides?) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : IMPORT Data problem - zip codes (text) lose leading zero Solved Topic
Poster Message
ba1959nh
Level: Scholar

Registered: 10-05-2006
Posts: 39

Ads by Lake Quincy Media
icon IMPORT Data problem - zip codes (text) lose leading zero

I wrote a VBA application in ACCESS.
We are now trying to import data from other db and xls files into the people table.  The ZIP CODE data created from the export loses the leading ZERO.
I have tried changing the data format in the exported file and then saving to CSV and another XLS but it keeps changing the format back and stripping off the leading zero.
The data is coming froma text field originally and I want to keep it that way, but EXCEL seems to want to change it no matter what I try.

Anyone have any suggestions?

P.S.
Not really sure how I got a Big Chesse classification.
I don't feel like one.


Thanks,
Bill


[Edited by ba1959nh on 17-08-2006 at 09:44 PM GMT]

17-08-2006 at 08:42 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 606
icon Re: IMPORT Data problem - zip codes (text) lose leading zero

Hi,
Format the column in the Excel Worksheet as "Text".
Save file as a CSV.
Use the Access Import Data Wizard to import the csv file, making sure that at the relevant point in the wizard you select that column and set the data type as "Text".
The data will import to your new table with the leading Zeros.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

Ads by Lake Quincy Media
19-08-2006 at 08:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : IMPORT Data problem - zip codes (text) lose leading zero Solved Topic
Previous Topic (Sometimes Excell does not show anything)Next Topic (Any Free VBA Guides?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder