Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    9

    Unanswered: Exporting query to specific folder

    Hi,
    I'm trying to set up a command button that will export a query to excel, but allow the user to choose the folder/directory where it will be saved and what to name the excel file. The current code I have in place , DoCmd.TransferSpreadsheet,simply exports the file to My Documents, while overwriting any existing file with the same name.

    Any suggestions?
    Thanks

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Check out the Common Dialog to prompt for file name/path, and then insert that as the appropriate argument in the TransferSpreadsheet method.

    I think Poot's example in the Code Bank also illustrates this.
    Me.Geek = True

  3. #3
    Join Date
    May 2009
    Posts
    9
    Thanks for the suggestion.

    Ends up that I just created a macro using OutputTo and it works wonderfully for what I need.

    Thanks again for the help

Posting Permissions

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