cbs81
06-05-2007, 04:28 PM
Hi, im puzzeled.
I have an access data base that has two colums of data, a driver name in the first column and an ID number in the second column.
in access, I do a data sort by ID number and then, when I run the following code it dumps this data in excel, but its not sorted in the same order as in excel.
My objective is to have this data automatically sorted in excel without having to do anything in excel... ie.. I want the sorted version in Access to be dumped in excel, exactly as it appears in Access...
the code i have running in access is as follows
Option Compare Database
Function modTransfer()
On Error GoTo modTransfer_Err
'docmd.TransferSpreadsheet TransferType, Version, TableName, _
'FileName, HasFieldNames(True/False), Range
DoCmd.TransferSpreadsheet acExport, 8, "MASTER", _
"H:\Cash reconciliation progressive backup\clarks driver database migration\Driver Database.xls", True, ""
modTransfer_Exit:
Exit Function
modTransfer_Err:
MsgBox Error$
Resume modTransfer_Exit
End Function
What do I do and how do i do it??
I have an access data base that has two colums of data, a driver name in the first column and an ID number in the second column.
in access, I do a data sort by ID number and then, when I run the following code it dumps this data in excel, but its not sorted in the same order as in excel.
My objective is to have this data automatically sorted in excel without having to do anything in excel... ie.. I want the sorted version in Access to be dumped in excel, exactly as it appears in Access...
the code i have running in access is as follows
Option Compare Database
Function modTransfer()
On Error GoTo modTransfer_Err
'docmd.TransferSpreadsheet TransferType, Version, TableName, _
'FileName, HasFieldNames(True/False), Range
DoCmd.TransferSpreadsheet acExport, 8, "MASTER", _
"H:\Cash reconciliation progressive backup\clarks driver database migration\Driver Database.xls", True, ""
modTransfer_Exit:
Exit Function
modTransfer_Err:
MsgBox Error$
Resume modTransfer_Exit
End Function
What do I do and how do i do it??