Help Please!

Gurn

Registered User.
Local time
Today, 04:02
Joined
May 6, 2004
Messages
12
I am having a problem when transfering an excel file to my database... For some reason when I transfer the file the bottom few records end up on the top of the list when it get into a table... 90% of the time it's the bottom 5 that end up on top...
Here is the code I am using currently:

DoCmd.TransferSpreadsheet acImport,acSpreadsheetTypeExcel9, "tblSequSched", "\\bb-srv01\PalletMarker$\Schedule\" & strName & ".xls", True


Is there a different way to pull an excel file in, or is my code wrong????

Thanks for the help,

Gurn
 
have you tried importing an .xls from the file menu? You have the option of importing into a new table or an existing table.
 
I need to figure out how to do it progammically, because this file with be imported into the database daily...

Gurn
 
The question to consider is this:

... 90% of the time it's the bottom 5 that end up on top

So what is it about the other 10% that makes it stay in the right order?

Usually, when you define a key, records appear in key order. So is it possible that the key is in reverse order in your spreadsheet?

Also, here is a thought: If your problem is to CREATE a new table each time to hold the imported data, which you would later append to its final destination, you could choose to ERASE a table (but not delete it) each time. That way, you can define the key order. Then import to an existing table each time. Process it. Store it. Erase it for the next round.
 
A table is an unordered dataset, unless you have a key as DocMan points out. Without a key to deterimine the order, the layout of the data in the table is irrelevant.
 

Users who are viewing this thread

Back
Top Bottom