Maybe:
DoCmd.SetWarnings False
'do something
DoCmd.SetWarnings True
Or use CurrentDb.Execute method.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
If I want my Access to disable pop-up confirmations,
I issue DoCmd.SetWarnings False when starting the program,
then issue DoCmd.SetWarnings True when exit the program.
do I right?
If by program you mean a procedure, yes. If you mean the application, then no.
I've never really needed to do this. I use CurrentDb.Execute for VBA execution of SQL actions and don't have to worry about Warnings.
Last edited by June7; 01-17-2023 at 03:57 AM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Personally I wouldn't use setwarnings on app open (no need to use it on close) - it could hide all sorts of issues. You'll be back here asking why something isn't working, completely forgetting you have turned warnings off.