B
bgetson
I have a pretty simple select query that does some minor calculations,
but for some reason, the SQL code inisde of the query keeps getting
erased. Every night I run a process from Excel that tells Access to
export the data from two different queries. The same subroutine
handles both queries (from a variable parameter) and uses the
DoCmd.OutputTo command to export both queries as an .xls file.
If the SQL is working beforehand, the process runs fine, and the
queries are exported. Afterwards, the query is only left with
"SELECT;". As far as I can tell, this is the only process that
references this specific query.
As a side note, the other query is a union query. Also, this process
has run fine in the past, and it is only recently when I added an
additional table to the database (which doesn't affect any queries)
that any of this started happening. The only change to the relevant
data structure is that I changed that name of a table I was
referencing. However, even if I create a fresh select query and copy
the SQL into it, the same problems occur.
Any ideas? It's getting tedious to copy the SQL in every morning.
Thanks for your help.
but for some reason, the SQL code inisde of the query keeps getting
erased. Every night I run a process from Excel that tells Access to
export the data from two different queries. The same subroutine
handles both queries (from a variable parameter) and uses the
DoCmd.OutputTo command to export both queries as an .xls file.
If the SQL is working beforehand, the process runs fine, and the
queries are exported. Afterwards, the query is only left with
"SELECT;". As far as I can tell, this is the only process that
references this specific query.
As a side note, the other query is a union query. Also, this process
has run fine in the past, and it is only recently when I added an
additional table to the database (which doesn't affect any queries)
that any of this started happening. The only change to the relevant
data structure is that I changed that name of a table I was
referencing. However, even if I create a fresh select query and copy
the SQL into it, the same problems occur.
Any ideas? It's getting tedious to copy the SQL in every morning.
Thanks for your help.