Delete warning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

When i run the delete command...

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

what is the best way to suppress the delete warning?

There was an earlier post that said to use:
Docmd.SetWarnings False
<SQL delete statements>
Docmd.SetWarnings True

or else

dbEngine(0)(0).Execute "DELETE...", dbFailOnError

but these were when the Delete statments were SQL statements. Are either of
those lines okay to use with my delete statements?

Thanks
 
Hi,

I tried it so my complete code is

Me.AllowDeletions = True
DoCmd.SetWarnings = False ' Suppresses the warning message
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Me.AllowDeletions = False
DoCmd.SetWarnings = True

I get the following error:
"Compile error: Argument not optional"

Any ideas?

Thanks
 
--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
juicegully said:
Hi,

I tried it so my complete code is

Me.AllowDeletions = True
DoCmd.SetWarnings = False ' Suppresses the warning message

No equal sign, the syntax is:

DoCmd.SetWarnings False
 
Thanks
I should've read it more throroughly


Michael J. Strickland said:
--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------


No equal sign, the syntax is:

DoCmd.SetWarnings False
 
Back
Top