Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete a Record Without prompting user

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
How do I delete a record w/o prompting the user?
 
Under Tools/Options/Edit/Find there are three checkboxes under Confirm which allow you to suppress the confirmation messages.&nbsp;&nbsp;However, these will affect all confirmations throughout your system.&nbsp;&nbsp;You may not want the messages to be suppressed everywhere.<br><br>If you want to be more selective about suppressing the message, create a delete query that will delete the selected record.&nbsp;&nbsp;Let's say it's called &quot;qryDeleteRecord&quot;.&nbsp;&nbsp;Then write some VBCode that looks like this:<br><br>Docmd.SetWarnings Off<br>Docmd.OpenQuery &quot;qryDeleteRecord&quot;<br>Docmd.SetWarnings On<br><br>and put it in whichever event makes sense logically within your application.
 
How do you make a Delete Record query?
 
First back up your table!&nbsp;&nbsp;It sounds like you're very new to Access.&nbsp;&nbsp;;-)<br><br>In the database window, click on the Queries tab. Click on the New button. Choose Design View and click OK.&nbsp;&nbsp;Select the table that you want to delete a record from.&nbsp;&nbsp;Click Add.&nbsp;&nbsp;Click Close.&nbsp;&nbsp;Double click on the * in the table that shows up in the upper part of the query window.&nbsp;&nbsp;From the Menu Bar, click Query and then Delete Query.&nbsp;&nbsp;Fill in the criterion row in your query so that you will select the correct record for deletion.&nbsp;&nbsp;Click on File/Save and name your query.&nbsp;&nbsp;You now have a query that will delete a record from a query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top