+ Reply to Thread
Results 1 to 3 of 3

VBA DoCmd.TransferSpreadsheet acExport... Sort Order

  1. VBA DoCmd.TransferSpreadsheet acExport... Sort Order

    I have a table whose fields are sorted in a certain order. Is there a
    way to retain or specify the sort order when using
    DoCmd.TransferSpreadsheet acExport... to export to a spreadsheet?
    Thanks, Sheldon Potolsky


  2. Re: VBA DoCmd.TransferSpreadsheet acExport... Sort Order

    Sheldon wrote:
    > I have a table whose fields are sorted in a certain order. Is there a
    > way to retain or specify the sort order when using
    > DoCmd.TransferSpreadsheet acExport... to export to a spreadsheet?
    > Thanks, Sheldon Potolsky
    >


    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Instead of transferring the table, use a query to retrieve the data in
    the sorted order you want and transfer the query.
    --
    MGFoster:::mgf00 earthlink net
    Oakland, CA (USA)
    ** Respond only to this newsgroup. I DO NOT respond to emails **

    -----BEGIN PGP SIGNATURE-----
    Version: PGP for Personal Privacy 5.0
    Charset: noconv

    iQA/AwUBRqkE8YechKqOuFEgEQIvpgCgwYQi9bk0AF/rI4LRrKY7u3xmt70AoN65
    xA5A2ILnLD/I9qv5uT9l7ype
    =HFPW
    -----END PGP SIGNATURE-----

  3. Re: VBA DoCmd.TransferSpreadsheet acExport... Sort Order

    On Jul 26, 4:31 pm, MGFoster wrote:
    > Sheldon wrote:
    > > I have a table whose fields are sorted in a certain order. Is there a
    > > way to retain or specify the sort order when using
    > > DoCmd.TransferSpreadsheet acExport... to export to a spreadsheet?
    > > Thanks, Sheldon Potolsky

    >
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Instead of transferring the table, use a query to retrieve the data in
    > the sorted order you want and transfer the query.
    > --

    Would the syntax be the same except for substituting the SELECT?
    query name instead of the table name?
    e.g. Would
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
    "tblAbsenceNotesSent", InputFileHSMS & "AllLetters.xls", True
    become
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query1",
    InputFileHSMS & "AllLetters.xls", True
    Sheldon Potolsky



+ Reply to Thread