Prompts are disabled

M

Mark

I am working on a access project and sometimes my prompts dissappear. When I
close a form, query or table I do not get a prompt asking me to save. The
corresponding form, query or table is saved after I close it. I noticed from
reading this discussion group that there is a setwarnings option. I was not
even aware this was available. What is really strange is that some days when
I work on the project my prompts are gone and other days they are back. I do
have an update and make table query, but I don't see an option to turn
warnings off.

Any suggestions??
 
N

Nikos Yannacopoulos

Mark,

You can SetWarnings to No/Off either in a macro, or in VBA code. In the
former case the default On setting is restored as soon as the macro
execution terminates; in the latter, on the other hand, you must
explicitly seret the warnings back to True in your code. Obviously your
problem is in a VBA procedure.

To reset manually: go to the immediate window of the VBA screen
(Ctrl+G), type the following:

DoCmd.SetWarnigns = True

To cure the problem: in the VBA window, searchthe whole project for
SetWarnings, and make sure wherever there is a False it is followed by a
True right after the action for which the False was used.

HTH,
Nikos
 
M

Mark

Thanks for the response. I tried finding "set warnings" in my vba code and
it does not exist. I then setup a macro to turn set warnings and the macro
didn't work. It is a very haphazard situation. Sometimes it just goes off
and on when I am working.
 
L

Larry Linson

"Mark" wrote
Thanks for the response. I tried finding
"set warnings" in my vba code and
it does not exist. I then setup a macro to
turn set warnings and the macro didn't work.
It is a very haphazard situation. Sometimes
it just goes off and on when I am working.

Type a new line in your VBA code with DoCmd.SetWarnings, press F1, and you
should bring up the very simple Help information needed for it.

How/when were you executing the macro? I almost never use macros (AutoKeys
is the only one that I know which provides functionality not available in
VBA, and that is functionality that I rarely need), but I am not aware of
macros sometimes working and sometimes not, unless they are sometimes run or
sometimes not.

Larry Linson
Microsoft Access MVP
 
N

Nikos Yannacopoulos

Moreover, to the best of my knowledge, the effect of a SetWarnings > No
in a macro does not outlive the macro (as opposed to a DoCmd.SetWarnings
= False), so I don't think the "guilty" action is in a macro.

Nikos
 
Top