Re: Problem Importing from an Excel spread sheet to an Access 2003 table.
From: Casey (anonymous_at_discussions.microsoft.com)
Date: 03/18/04
- Next message: GSteven: ""External Table Isn't In Expected Format" error - multiple machines"
- Previous message: Bill: "Importing A MS Works 2000 Database"
- In reply to: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Next in thread: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Reply: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Mar 2004 10:46:51 -0800
Hello John,
Is it possible in Access to format all zip codes to
display 5 digits with a single command?
This would get me away from the problem of importing it
correctly. I would just have to apply a change
afterwards.
If there is a way to format a field with in Access after
the fact would work as well. To have the output change
from what ever is in the Zip code field for data to now be
displayed as 5 digits and 5 digits only.
I have the field property data type currently set to text.
I can change it to what ever it needs to be.
Casey,
>-----Original Message-----
>Hi Casey,
>
>As others have said, it's not possible to do this in one
step. It is
>possible in two stages or by writing custom VBA code, in
any of these
>ways:
>
>1) Modify the Excel sheet before import by prefixing an
apostrophe ' to
>the Zip code field. This can be done manually or under
program control
>from Access via Automation.
>
>2) Import the data to a temporary table, losing the
leading zeros. Then
>use an append query to move the data into a "permanent"
table, with a
>text field for the Zip codes. Use an expression or custom
VBA function
>in a calculated field in the query to restore the leading
zeros.
>
>3) Write VBA code that uses Automation to extract the
data from
>individual cells in the Excel sheet and append it a
record at a time to
>the Access table.
>
>Of these, (2) is probably the simplest.
>
>
>
>On Wed, 17 Mar 2004 09:38:36 -0800, "Casey"
><anonymous@discussions.microsoft.com> wrote:
>
>>
>>Hello,
>>
>> I am not sure if I should be posting this question here!
>> Or in Tables and Database Design. I will start here
since
>> this is a question about importing data.
>>
>> My problem is that when I attempt to import data from
an
>>Excel spread sheet into an Access 2003 table. The first
>>zeros that I have in a zip code field are not getting
>>carried over to the access table.
>>
>> Now I would like to correct this in one shot. I tried
>>setting up a custom imput mask such as \00000\-00000
>>
>> This added a zero to the front of all the zip codes.
>> Not all of my zip code entries start with zero.
>>
>> I just want to copy over what is actually in my excel
>>spread sheet.
>>
>> And perhaps latter automatically add all zeros for the
>>last five digits.
>>
>> For right now how ever. All that there is are five
>>digits.
>>
>> Some start with zero. Some do not.
>>
>> I would really appreaciate some help on this. I keep
>>coming back to this issue over the past couple of weeks.
>>
>> Currently I am no closer to figuring this out from my
>>refrence manual.
>>
>> Thank you,
>>
>> Casey,
>
>--
>John Nurick [Microsoft Access MVP]
>
>Please respond in the newgroup and not by email.
>.
>
- Next message: GSteven: ""External Table Isn't In Expected Format" error - multiple machines"
- Previous message: Bill: "Importing A MS Works 2000 Database"
- In reply to: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Next in thread: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Reply: John Nurick: "Re: Problem Importing from an Excel spread sheet to an Access 2003 table."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|