Run the Delete Query on Exit?

  • Thread starter Thread starter J.Bennett
  • Start date Start date
J

J.Bennett

I have a database that is used to provide quotes for storage buildings. If
the customer wants to actually purchase the building, then the user proceeds
with entering the customers name, address, etc. The querry I have set up
deletes all records that do not have either a first name or last name. It
all works exactly as I want.

Is there a way to run this delete query upon exiting the database? I would
prefer the "Are you really sure you want to delete these... or whatever it
says..." message box to not pop up.

Any help would be appreciated.
 
Of course, if the user "exits" by turning off the power, or if there's a
power cut or the computer simply fails, then your query will not run.
Obviously it'll run again when he next launches the application and shuts it
down properly (if he ever does!), but really it might be better to run your
query when the application *starts* rather then when it exits.
 
Thanks! This works great. I actually had an opening splash screen that the
user must click on to close before proceeding so I set the code to run on
close of this form.
 
Thanks. I incorporated your suggestion. I have an "Splash Screen" that opens
automatically that has disclaimers. The user must click on the screen before
moving on. I have the delete query run on close of this screen. It works
great. Thanks for the suggestion.
 
Back
Top