Delete Query

  • Thread starter Thread starter Duane
  • Start date Start date
D

Duane

I have a delete query I use when I open my form. Here is the code;

Private Sub Form_Close()

DoCmd.OpenQuery "Delete", acViewNormal

End Sub

I would like for the query to run without the user having to respond to the
prompts;

"You are about to run a delter query that will modify the data in your
table". Yes/No
"You are about to delete 0 row(s) fromthe specified table." Yes/No

Is it possible to run this query in the background when my form is opened?

Thanks in advance.
 
Use:

DoCmd.SetWarnings False
DoCmd.OpenQuery "Delete", acViewNormal
DoCmd.SetWarnings True

--

Sco

M.L. "Sco" Scofield, MCSD, MCP, MSS, Access MVP, A+
Useful Metric Conversion #16 of 19: 2 monograms = 1 diagram
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
Back
Top