Import Range

L

Leo

Hi -

I am trying to figure out how to do the following task.

I need to import the an excel range into a column in
Access.

The range 'Part_Number' is entered as '123-456-789' in
excel. However, the field type in my Access table is
defined as 'Number' (I can't change this).

How do I import this range such that '123456789' is
imported instead of '123-456-789'?

I am using the following code:
!PartNumber = xlssheet.range("Part_Number")

But this gives me an error.

Is there a solution out there for my problem??

Please advise! Thanks!!
 
J

John Nurick

Hi Leo,

If
!PartNumber = xlssheet.range("Part_Number")
works apart from the formatting of the number, try something like

!PartNumber = CLng(Replace(xlssheet.Range("Part_Number").Value,
"-", ""))
 
L

Leo

JOHN YOU ROCK IT WORKS!! THANKS!!!

-----Original Message-----
Hi Leo,

If
!PartNumber = xlssheet.range("Part_Number")
works apart from the formatting of the number, try something like

!PartNumber = CLng(Replace(xlssheet.Range ("Part_Number").Value,
"-", ""))


Hi -

I am trying to figure out how to do the following task.

I need to import the an excel range into a column in
Access.

The range 'Part_Number' is entered as '123-456-789' in
excel. However, the field type in my Access table is
defined as 'Number' (I can't change this).

How do I import this range such that '123456789' is
imported instead of '123-456-789'?

I am using the following code:
!PartNumber = xlssheet.range("Part_Number")

But this gives me an error.

Is there a solution out there for my problem??

Please advise! Thanks!!

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 

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

Similar Threads

Merge Records 1
Excel format conversion 9
access newbie 2
Count Unique accross mulitple columns 7
link field 2
Data Matching 1
Excel Data Import 1
Query specific data 3

Top