DoCmd.SetWarnings False is not working

  • Thread starter Thread starter Jill
  • Start date Start date
J

Jill

In one of my macros, I put the Set Warnings command to false, and all of the
dialog boxes are still coming up. Can anyone see what I'm doing wrong here?

Function Update_tbl_Master1()

DoCmd.SetWarnings False
DoCmd.DeleteObject acTable, "tbl_Master"
DoCmd.CopyObject "", "tbl_Master", acTable, "tbl_Master_Blank"
DoCmd.RunMacro "Import Holiday07 Master Spreadsheets", , ""
DoCmd.OpenQuery "qry_Add tbl_Master_Holiday07 to tbl_Master",
acViewNormal, acEdit
DoCmd.OpenQuery "qry_Add Holiday07 Source to tbl_Master", acViewNormal,
acEdit
DoCmd.RunMacro "Import Spring08 Master Spreadsheets", , ""
DoCmd.OpenQuery "qry_Add tbl_Master_Spring08 to tbl_Master",
acViewNormal, acEdit
DoCmd.OpenQuery "qry_Add Spring08 Source to tbl_Master", acViewNormal,
acEdit
DoCmd.SetWarnings True

End Function
 
Jill

"All" ... or most?

I've noticed that some code seems to turn the warnings back on, even though
I didn't. I don't recall which ones, but my work around was to set warnings
off before each command, and turn them on explicitly after all of them.

Have you tried setting a breakpoint in this function so you can watch, step
by step, where this happens?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
I didn't even think of setting the warnings around each offending query...

that did the trick.

Thanks for your help!
 
Back
Top