Results 1 to 5 of 5
  1. #1
    Join Date
    May 2010
    Posts
    4

    Unanswered: Macro is deleting one of my queries when it runs

    Hi all, I have created a macro that outputs a query into a an excel spreadsheet. This macro works perfectly well the first time; however, if I run the macro again I receive an error, and the query that drive the export is now completely blank. The macro is deleting the contents of the SQL in the query.

    Can anyone shed some light on this?

  2. #2
    Join Date
    May 2010
    Posts
    601
    What is the contents of you macro?
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    May 2010
    Posts
    4
    It's a simple macro that I built with the macro builder. It simply exports to excel -the results of a basic query that I had previously created. There is only on event listed in the macro builder, that is: Output To. The thing is, when I run it the first time it works perfectly, however if I run it again I get an error that the query must contain at ;east one desitination......... It appears that the macro is deleting the contents of the query after it runs for the first time, so when I try to run it again, the query contains no SQL.

    I hope that is a bit clearer?

    Thanks,

  4. #4
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by simonsa View Post
    It's a simple macro that I built with the macro builder. It simply exports to excel -the results of a basic query that I had previously created. There is only on event listed in the macro builder, that is: Output To. The thing is, when I run it the first time it works perfectly, however if I run it again I get an error that the query must contain at ;east one desitination......... It appears that the macro is deleting the contents of the query after it runs for the first time, so when I try to run it again, the query contains no SQL.

    I hope that is a bit clearer?

    Thanks,
    Not really.

    What is the actual macro command(s)?

    Is it possibvle to paste it here?
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  5. #5
    Join Date
    May 2010
    Posts
    4
    Please see attachment.

    Thanks for your help
    Attached Files Attached Files

Posting Permissions

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