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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Surpressing the "You are about to delete x records" message

Status
Not open for further replies.

mdav2

Programmer
Aug 22, 2000
363
GB
I have a form that is bound to a query\table. I have a some code that creates a recordset and uses the delete method to remove a record in the table. This all works fine but I get the annoying message "You are about to delete x records". Is it possible to turn this message off then back on again.

I may have to use a query and the docmd.setwarnings false/true syntax.

The record that will be deleted will always be the current record.
 
If you want it for the one time event (not to globally stop all message) then yes, you would use the setwarnings property. If you are 100% sure it will always be the current record you can use the following code

DoCmd.SetWarnings = False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings = True

This will turn it off, delete the record, then turn the warnings back on...

Hope this helps Programming isn't a profession of choice.
It's a profession of calling...
"Hey Programmer, your application broke again!" [spin]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@ssmb.com
 
Not sure, but you should be able to use DoCmd SetWarnings False/True within the code itself - at least you could do so in Access 2.0.
 
It works when you run a query but not a rst.delete statement. I have now changed this to runs as a query and to do a "me.requery" to get rid of the "#Deleted" in the forms textboxes.

Thanks for the responses
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top