问题
More of an annoyance than anything else, but I couldn't find any information on it in Google.
I'll often create a query in Access 2007 to test something, or quickly grab some results on a one time basis. I don't want to save these queries, as they're only good for one use.
Not always, but often, Access won't close this query without me saving it, which then means I have to later delete it. This can prevent me from closing Access until I've saved it, and creates a derth of unwanted queries.
Why is this happening? Is there something in particular that sets it off?
回答1:
The Track name AutoCorrect info
path was not what did it for me. Rather it turns out I had left DoCmd.SetWarnings False
set. Going into the immediate window and running DoCmd.SetWarnings True
brought back the old "Do you want to save this query Yes/No/Cancel" window.
回答2:
As a wild guess, I'll suggest you check whether Track Name AutoCorrect is causing the behavior you described. If it is enabled, disable it temporarily and see if Access still forces you to save new queries instead of simply discarding them.
The reason I offer this suggestion is because I've never seen that behavior. Whenever I attempt to close a new unsaved query, Access asks me whether I want to save the query design, and just discards the unsaved query when I respond "No".
And I never leave Track Name AutoCorrect enabled because it's reported to create too many problems (Flaws in Microsoft Access: Problem properties and Failures caused by Name AutoCorrect). Of course this may just be a coincidence, but I think it could be worthwhile to check whether autocorrect is involved.
And if Track Name AutoCorrect is the cause, you would then need to decide which is less painful: leave Track Name AutoCorrect disabled permanently; or be forced to save new queries you don't want to keep.
回答3:
If you have turned off warnings in VBA (DoCmd.SetWarnings False
) but haven't turned them on later, you'll get this behavior every time. Remember that:
- You should always turn warnings on when you're finished with a procedure
- If you error out of a procedure that has turned warnings off, they're probably still off.
Try going into VBA, call up the Immediate window (Ctrl+G
), type in DoCmd.SetWarnings True
and hit Enter
.
回答4:
Weird one this.. I too had exactly the same problem whereby i was only give the option to Save or Cancel the query. Found this thread and checked the Track Name AutoCorrect and it was set to Off.... turned it on, then cancelled out when it said it wanted to map the database and hey presto my query dialog changed to Do you want to save, Yes No or Cancel.. so you may only need to click on/off to reset this "feature"
来源:https://stackoverflow.com/questions/15761959/access-2007-inists-on-saving-queries