Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access to Excel (A2K)

    I use the following to export my query to Excel and it works very well.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, Me.RecordSource, "E:RoomSizes.xls", True

    However, is there a way to have the Excel headers reflect the "Captions" in my query as opposed to the column name? I can do this if I export manually and check the "Save Formatted" box. Thanks in advance for any help.
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Access to Excel (A2K)

    Instead of using captions in the query, prefix the field name in the query grid with the caption followed by a colon and a space. For example, if you have a field strLastName with caption Last Name, change the entry in the Field row of the query grid to

    <code>Last Name: strLastName</code>

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access to Excel (A2K)

    Hans,

    As Mr. Smithers would say on the Simpson's -- Excellent! If you don't watch the Simpson's, Excellent, anyways,

    Andy
    Cheers,
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •