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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple queries, reports - pause between 10
Bizzare delete query problem 15
Evaluate query results 10
Append queries 11
VB command 2
Create Table Auto Answer 2
The database could not lock table 1
docmd open query 2

Back
Top