DoCmd.SetWarnings False meaning

Ajwc

New member
Local time
Today, 04:18
Joined
Apr 4, 2013
Messages
6
What does the "False: do in this code?
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteEmptyAppointments"
DoCmd.SetWarnings True

What does the "True" do in this code?
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteEmptyAppointments"
DoCmd.SetWarnings True
 
1. I 'd suggest you look it up in the Access helpfile - select the thing you want to question and press F1. If that fails then google the entire line
2. Comment one of them out by inserting an ' at the beginning of the line and see what happens
 
^^^I've already tried Googling and searching the Access helpfiles
 
^^^I've already tried Googling and searching the Access helpfiles

Strange I just Googled it and got plenty of hits, are you saying that you don't understand the information in those hits?

Brian
 
*Sigh* I know what the code does, since I typed it in.

Long story short I'm learning to use Access, and I want to know what the True/False does.
 
it turns on and off certain confirmation warnings when you run action queries, and when you delete/manage database objects.

note that if you setwarnings false in code, you have to set them true in code. the setting in access options is subordinate to the setwarnings setting.
 
:confused:

Dave has said no more than the hits one gets when googling.

Brian
 
I would add something that may not be in the help file - if you use this command, and I would not use it unless absolutely necessary, you need to have
DoCmd.SetWarnings True
in the exit point of your code so that if the Error handler is entered before it can be reset, you won't find yourself without warnings. And this can affect things like when you ate developing and you go to close something you have worked on, it may not give you the box that asks if you want to save, it may either just save your changes without asking or more likely it will just discard them without asking.
 

Users who are viewing this thread

Back
Top Bottom