delete record

mstephen

New member
Local time
Today, 10:36
Joined
Mar 20, 2009
Messages
8
I'm running an update query in a macro/module and want to add "delete record" to it. Keying off of tlb-field name-text in field. I added a delete query to the macro/module and that didn't work. It seem to override the existing update query that's in the module. So I'm looking for the delete record expression or code to add to the existing update query.
 
You need 2 separate queries, but if you are basing it on the same information, you might do an update and then delete that updated record. Can you provide more details such as the code you have tried?
 
I have added the second delete query and it's working fine now. There is one how to:; I have turned off or unchecked the confirmation message box that you get when you run the updat/delete query (tools/options/edit find/action query) is there any code to run in the module ONLY thus allowing me to keep the confirmation box checked for other action querries?
 
To suppress the warnings in VBA code, you would need the following:

DoCmd.SetWarnings False

query commands


DoCmd.SetWarnings True


Alternatively you can use the following

currentDB.execute queryname, dbfailonerror
 
Glad that worked for you. Good luck on your project!
 
To suppress the warnings in VBA code, you would need the following:

DoCmd.SetWarnings False

query commands


DoCmd.SetWarnings True


Alternatively you can use the following

currentDB.execute queryname, dbfailonerror

if you use this be sure to put in an error handler and include the DoCmd.SetWarnings True in the error handler so you don't find yourself without error messages at all if something fails before it can get back to being reset.
 

Users who are viewing this thread

Back
Top Bottom