Access Deletes the SQL Code in Query after running output macro

  • Thread starter Thread starter AzNAUstudent
  • Start date Start date
A

AzNAUstudent

I have a button setup to run a macro that does a OutputTo command on a
query to Excel 97-2003. The macro runs fine, but after it is done for
some reason the SQL code in the query is deleted and it only does it
some of the time. I'm not quiet sure what is causing it because if I
recreate the query it didn't happen again. Then I thought it was okay
but on Friday it happened again on another macro while I was trying to
show the Access file to the user. So is this a known bug or am I doing
something wrong?
 
AzNAUstudent,

Can you please post back with details of the macro, i.e. all the actions
in the macro and relevant arguments? Thanks.
 
Action: OutputTo

Arguments:
Object Type: Table
Object Name: qry_followup
Output Format: Microsoft Excel 97-2003 (.xls)
Output File:
Auto Start: No
Template File:
Encoding:

Output File, Template File, and Encoding I left blank.

It has happened to 2 different macros setup the same way just different
queries run.
 
AzNAUstudent,

I do not know why this is happening. Do you mean that after the macro
is run, the qry_followup still exisits in your database, but it is
completely blank?

Anyway, why have you used 'Table' instead of 'Query' in the Object Type
argument in your macro?
 
Back
Top