Access erases query SQL code

  • Thread starter Thread starter PMW
  • Start date Start date
P

PMW

Cant identify the precise conditions but Access VBA (2000,2&3) occasionally
errors when I am trying to export the results of a query to a .xls. When I
check the query code the query is empty, where it was definitely not the last
time I checked! What's going on?
 
When you say "check the query code" are you referring to the query's SQL
statement (as in SQL view of the query), and that is gone? Or do you mean
that there are no results when you run the query?

If you get results when you run the query, you should not have any issues
exporting the data to Excel (or whatever) generally speaking.

If you can explain again step by step what you are doing and what happens,
that might help get to an explanation. Thanks.
 
PMW said:
Cant identify the precise conditions but Access VBA (2000,2&3) occasionally
errors when I am trying to export the results of a query to a .xls. When I
check the query code the query is empty, where it was definitely not the last
time I checked! What's going on?

Yes, I have had this problem too, especially with complex queries on Oracle
tables.

I got in the habit of copying the sql query into an external editor and
working on it there, saving it to disc, and copying/pasting it back into the
Access query editor, so I still had a copy if Access had a fit and threw it
all away again.

(Going into query design mode seemed to trigger wiping out the sql text
quite often too).
 
Back
Top