Docmd.Setwarnings True Doesn't work!!

S

smashing_austin

Hi All,

I'm using MS Access 2003 (SP1) and am having a terrible time doing
something that seems very simple!

All my system messages are suppressed, and I know this because any
change I make to a query/table (etc) is automatically saved without
any prompting. Also, any action queries are automatically run without
being prompted "You are about to delete xx rows etc". In the Tools ->
Options -> Edit/Find tab, the boxes are ticked to True for Record
Changes, Document Deletions and Action Queries.

I want to turn system messages back on to understand the errors I am
having with a particular Append query, however I can't seem to do it!
I have created a new module in VBA, and created the following sub:

Sub Test()
Docmd.Setwarnings True
End Sub

Even after running this sub above, system messages refuse to turn on!
There seems to be no way to turn them back on again. I can't find any
articles in KB or in Google Groups, and I am absolutely baffled!

I would really appreciate any help - Cheers, Angela
 
G

Guest

Try this:
DoCmd.SetWarnings -1

Also did you cut and paste this?
Sub Test()
Docmd.Setwarnings True
End Sub

If so something is amiss as it should have automatically capitalized the C
and W like so below. Access might not be seeing is as code. What color is the
text? Also what happens when you try to compile the database?

DoCmd.SetWarnings True
 
S

smashing_austin

Hi Tom, Jerry

Thanks to you both for your responses. I have tried all your ideas:
1. Toggling Confirm - Action Queries on and off
2. Docmd.Setwarnings -1
3. Compacting and Repairing the database. Jerry - how would I compile
the database?

Still no improvement unfortunately - I am still not being prompted
when I run an action query or close a query that has been changed
(changes are automatically saved).

Also, Jerry, the code I pasted was not cut and pasted - I just typed
it in. In my code, however, it is definitely understood as code
(correct capitalisation and spacing etc).

Finally, I have checked in other Access databases that I use, and I am
being prompted there for action queries and saving changed queries. So
the problem is isolated to this one database.

Thanks again guys - any other possible ideas?

Cheers, Angela
 
G

Guest

It's almost like you have something running on a form timer event that sets
the warnings often. Also check your opening form or any other form that is
used often for the SetWarnings. The SetWarnings applies to the specific
database so you are correct that something strange is happening just that
database.

I must be getting dense in my old age. Try this: Do a Ctrl + g to bring up
the Visual Basic windows. Press the F7 key to bring up the Code window. Click
anywhere in it then go up to Edit, Find. In the Find What box type in
SetWarnings. In the Search options on the left side pick Current Project.
Now you should be able to see everywhere SetWarnings is used.

Here's a good site about decompiling.
http://www.granite.ab.ca/access/decompile.htm

If yu thing that it might be a corruption issue, Tony Toews has an excellent
web page on database corruption.
http://www.granite.ab.ca/access/corruptmdbs.htm

Allen Brown also has excellent info on corruption.
http://allenbrowne.com/ser-47.html

I have a white paper in a Word document named Fix Corrupt Access Database
towards the bottom this page:
http://www.rogersaccesslibrary.com/OtherLibraries.asp
 

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