Can I avoid the save of a query on window close?

dtburdick

Registered User.
Local time
Today, 18:48
Joined
Oct 29, 2002
Messages
33
I have an all-purpose query I display to the user on which they can filter/sort, etc. If they make any changes (filters, etc) it prompts them to save the query. Is it possible to avoid that prompt?
 
If you want the query to be saved, then you can set the warnings to False.

docmd.setwarnings false

This will turn off the save warnings. Make sure to turn them back on after the query is closed to avoid problems.

HTH,

Vassago
 
Where should I put the code? Is it possible to put code into a query? Like in a query.onclose event?
 
Do you present the data from the query on a form or report. You can place the code in the OnOpen or Onload event of the form or report, and then do the opposite in the OnClose event of the form or report. Where do you present the query's data?
 
docmd.setwarnings false , works fine when you're logged on a secure DB as Admin but problems arise when you log on as a restricted user, the "docmd.setwarnings" doesn't supress the prompt. You get a message about the "database not been opened in exclusive mode and can't save the query". I've been bangin' my head on this one for a while.
 
I tried putting it into a form to display as a datasheet. What I want to do is simple:

1) construct sql dynamically
2) display it for the user in a datasheet, allowing them to search.

I tried just running it as a query but that has issues because I have no control over the menu for the query.
 

Users who are viewing this thread

Back
Top Bottom