473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

TransferSpreadSheet problem import excel to access

Hello,
I've got a problem importing a worksheet Excel into a temporary table in
access. All the information is imported but the table is not ordered as it
is originally in excel.

I'm using a VBA code rather simple as the following:

Private Sub Import()
...
Dim TableName As String

DoCmd.TransferSpreadsheet , , TableName, XLFileName, , test!A10:AX"
....
End Sub

where XLFileName is my excel file and "test" my worksheet within that file.
This code imported perfectly all the records from the excel file but since
the worksheet increased number of lines up to 1800 (which I do not consider
is a big number!) all of them are imported but after the line 35 (not always
the same) jumps to te line 1400 or so, then comes back to the line 36 until
80, then again another jump...
Despite of having all data the different order does not help afterwards.

Any help out there?
Thanks beforehand
Qq
Feb 5 '07 #1
2 6882
Quique wrote:
Hello,
I've got a problem importing a worksheet Excel into a temporary table in
access. All the information is imported but the table is not ordered as it
is originally in excel.

I'm using a VBA code rather simple as the following:

Private Sub Import()
..
Dim TableName As String

DoCmd.TransferSpreadsheet , , TableName, XLFileName, , test!A10:AX"
...
End Sub

where XLFileName is my excel file and "test" my worksheet within that file.
This code imported perfectly all the records from the excel file but since
the worksheet increased number of lines up to 1800 (which I do not consider
is a big number!) all of them are imported but after the line 35 (not always
the same) jumps to te line 1400 or so, then comes back to the line 36 until
80, then again another jump...
Despite of having all data the different order does not help afterwards.

Any help out there?
Thanks beforehand
Qq

Hi Qq,

Tables do not have an inherent order. Order is obtained through queries,
assuming there is a field that facilitates order.

If you are looking at your table and asking, "why can I not find order
in this" it's because you should not be looking at the table at all.
Look at a query, or better yet, a form that takes its data and order
from a query. Then you can order the imported records in any manner
available.

Hoping this helps,
--
Smartin
Feb 6 '07 #2
The other consideration is that if you look at your imported table and
change the sequence as you are looking at it, access will remember
that sequence and always put it that way when you come back. It seems
that access creates and establishes a query by which you are looking
at the table and forever remembers that query.

I have spreadsheets that I import that I HAVE to maintain the import
sequece. I established an autonumber on the imported to table, and
whenever I want to look at it in exactly the sequence that it came in
as I sort it by that autonumber. Once I did that I have not had any
problems with the sequence.

In this application the information I am looking for is in groups of
successive lines and the fields are in different columns depending on
an identifier which is different and in different colums. And there
can be multiple and variable sets of sub information for each major
set. This mandates reading the table in exactly the sequence that it
was imported as. Hence the autonumber field, and I use vba code to
read a query of that table that is sorted in autonumber sequence.

Hope this gives you some ideas.

Ron

Feb 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: O'Donnell Tribunal | last post by:
Hello Everybody, I am using the TransferSpreadsheet method to import spreadsheets for processing. say my code looks like this: DoCmd.TransferSpreadsheet acImport, 0, _ "tbltempImport1", ""...
0
by: Mick Hardy | last post by:
Hi, Has anyone seen this weird behaviour or have any suggestions or can anyone reproduce it? The history: I converted a large third party DB from 97 to XP and it uses the...
1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
2
by: Anne Sachleben via AccessMonster.com | last post by:
I am using the TransferSpreadsheet function to export a query result to a specific worksheet in an Excel file titled "report". I want the result to be exported to the worksheet titled "facts". ...
6
by: sara | last post by:
I have a procedure to automate bringing several Excel files into our Access tables, on a daily basis. The problem is that if the user has a problem, and tries to run the import again (maybe 3...
0
by: 675i76 | last post by:
We've been using a macro to import Excel spreadsheets into an access 2002 database. After 5 months of this we found an error on a report. It turns out that access is ignoring the last row and last...
5
by: D.Stone | last post by:
I'm getting a problem with importing an Excel spreadsheet into a table in a SQL Server 2000 back-end. I'm doing this in VBA in an onClick event proc in an Access 2003 project. The target table's...
3
by: Icarus | last post by:
I'm using TransferSpreadsheet to import an Excel file in to MS Access 2003. DoCmd.TransferSpreadsheet acImport, 8, strTable, strFileName, True, "" One of the columns in the Excel file is a...
4
by: ambmil | last post by:
I am using transfertext and transferspreadsheet in VBA to import an excel file (.csv or .xls) into access 2003. Some of the fields are failing (I am getting an import error file), but I am not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.