Standard Import is Scrambling Numbers

Standard Import is Scrambling Numbers

Post by cnlndXk3Mj » Sat, 15 Nov 2008 04:26:12


I have a Pivot Table in Excel and I want to import the data into Access. I
run this code:
'etc...
DoCmd.RunSQL ("DELETE * FROM [Bookings - Pipe by Advertiser];")
DoCmd.TransferSpreadsheet acImport, 8, "Bookings - Pipe by Advertiser",
"C:\Documents and Settings\rs\Desktop\Forecasting\Up To Access\RVP
Revenue-Pipe.xls", True, "Pivot Sheet!A5:N2000"
'etc...
The names comes in fine, but the numbers sometimes appear random. Sometimes
the numbers are accurate and sometimes they are not (like off by 10k, and
other random amounts). The table is set up as data type Text and Number.
Does number have to be some other data type? What could cause this?

Please help.

Thanks,
Ryan---




--
RyGuy
 
 
 

Standard Import is Scrambling Numbers

Post by cnlndXk3Mj » Sat, 15 Nov 2008 05:34:01

Perhaps the Data Type should be Number and the Field Size should be Double???

--
RyGuy

 
 
 

Standard Import is Scrambling Numbers

Post by Jeff Boyc » Sat, 15 Nov 2008 09:56:28

Are you importing the pivot table or the underlying raw data?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
 
 

Standard Import is Scrambling Numbers

Post by cnlndXk3Mj » Sun, 16 Nov 2008 00:22:01

Thanks for looking Jeff. Actually, I created a macro in Excel to get the
Pivot Table and then, at the end of the macro, I did a copy/paste special to
get just the numbers (in Pivot Table format, but without the 'Pivot Table'
per se).

Anyway, I think I got a handle on it now. I had some blank rows in another
spreadsheet that I imported, and I guess something got lost during the
Transferspreadsheet process from Excel to Access. As I understand it, Access
doesn't like lots of blank rows. I used an Excel macro to delete all blank
rows. Also, in the Access Table, I changed the Data Type to Number and Field
Size was changed to Currency. Finally, in the Excel sheets, I converted
everything to Number format. Even though there is some text in there,
EVERYTHING on the Excel sheet is formatted as a number. The text always
imported fine...those numbers were importing correct for the most part, but
some were pretty screwed up. Finally, for anyone who someday encounters a
similar issue, and sees this post, make sure you have only numbers in a
column or only text in a column. In Column C, for instance, don't have this
in Excel: 23, 25, 34, fourty-nine, 56, 31. That was NOT my problem, but
during my research of this problem, I found this listed as a good idea of
what NOT to do.

Hope that helps others...


Ryan---

--
RyGuy