Access Deletes the SQL Code in Query after running output macro

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?
 
S

Steve Schapel

AzNAUstudent,

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

AzNAUstudent

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.
 
S

Steve Schapel

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top