Queries not saving/saving correctly

G

Guest

I created a new query and haven't saved it yet. I decide I do not want to
save the query. I use the "x" close button and it prompts me to save the
query, no other choice than to save or cancel (if I cancel it leaves me in
the query). I then try to close using File > Close, the same thing happens.
The only way to get out is to save the query, then delete the query after it
is closed.

Also, if I open an existing query, change anything in the query (enter a
parameter, change it from a make table query to a select query, etc) then I
decide not to save the changes and I close the query. It does not ask me if
I want to save the changes, it just closes and saves the changes anyway.

If I compact/repair the database it then works okay. However, it happened
yesterday, I did the compact/repair and it was okay. This morning it was
still okay, then suddenly it started to happen again. Once I did the
compact/repair it then worked okay again.

Has anyone come across this problem and if so what was your solution? Does
anyone know what could be causing this to happen?
 
J

Jason Lepack

Your Warnings are turned off.

Somewhere in your database there is the line "docmd.setwarnings false"
that is not later followed by "docmd.setwarnings true". Easiest way
to fix this is to create a new module and put these functions in it:

Public Sub turnoff()
DoCmd.SetWarnings False
End Sub

Public Sub turnon()
DoCmd.SetWarnings True
End Sub

You can execute turnon() to turn warnings on an watch your problem
disappear. You can also reacreate your problem by using turnoff()

I suggest you inspect your code to find out where you should be
turning warnings back on.

Cheers,
Jason Lepack
 
G

Guest

Thank you so much, Jason. You are a life saver!

And thank you for your quick response as well. You're amazing.

Rachel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top