Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferSpreadsheet Row/Sort Order?

Status
Not open for further replies.

IanGlinka

IS-IT--Management
Feb 28, 2002
215
US
Howdy all,

I have a Microsoft Access VBA app that is using the TransferSpreadsheet command to export a table in my database to an excel file. The export works fine, but the order of the rows does not always appear to be consistent.

The intended sort would be on a certain field called "DupID" -- and the program often sorts this correctly (DupID is the primary key). However, I have noticed this is not always respected when the exported file is generated.

Has anyone ever run across this before? I cannot for the life of me figure out which field(s) is/are being used as the ordering mechanism in these exports sometimes.

Perhaps there's some way of forcing a certain sort upon export when you are referencing a table?

Thanks,
Ian
 
You can use a query to "line up" the inforamtion.

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename, filename[, hasfieldnames][, range]

tablename A string expression that's the name of the Microsoft Access table you want to import spreadsheet data into, export spreadsheet data from, or link spreadsheet data to, or the Microsoft Access select query whose results you want to export to a spreadsheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top