Access 2007 inists on saving queries

放肆的年华 提交于 2019-12-10 13:02:16

问题


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:

  1. You should always turn warnings on when you're finished with a procedure
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!