Weird Bug: OutputTo deletes (!) Query

Jade74

Registered User.
Local time
Today, 17:11
Joined
Sep 13, 2007
Messages
10
Hi guys & gals,

I recently came across this really strange behaviour and was wondering if anyone else knows this bug or knows a better workaround than mine.

I've attached a little Events DB, which has a search interface. I've included an export button, which runs a macro that does an OutputTo (xls) of the search query.

Now if you do an export once, everthing is fine. The bug (at least I think it's a bug) occurs if you export a *second* time and *overwrite* the file you created earlier. The search query (which sits under the "Queries") tab is now empty and you get an error message.

My workaround idea was to dump the query to a new table every time you export and then do an OutputTo with this table. Not very elegant and you also have to do the whole error handling (e.g. user presses cancel) manually.

Does anyone have a better idea? Or am I doing somethng completely wrong and this is actually "by design"?!

Thanks in advance for any ideas!
 

Attachments

Try the form's searchtext field's on change event

From: Me.Results.Requery

To: DoCmd.Requery "Results"

And see if that works
 
Wow, you are a genius. How did you work that out?

Thanks heaps!

Any idea why your version works and mine doesn't?!
 

Users who are viewing this thread

Back
Top Bottom