Solved Creating a button to run a Delete Query

dullster

Member
Local time
Yesterday, 19:07
Joined
Mar 10, 2025
Messages
213
I have a Payroll table that when payroll is due, i run the append query to add it to my transactions table, then I run a delete query to clear out those records and start a new pay period. I created the delete query which works and want to set up a button to run the query. That query is not an option to run with a button. Is there a way to write a macro or something on click to run the query?
 
I think i finally got it. Thank you.
 
As you are deleting transactions relevant to payroll, you may want to instead put in a "Processed" flag that you update. This could be either a boolean or a Date/Time processed. This becomes incredibly useful when you need to show what you had prior to processing.

Personally I'd use date/time so I can archive them after a normal audit period.

This may sound like a headache now, but the first time you have to let a agency see your data for an audit you'll be glad you did.
 
Implement the suggestion by @Mark_ .
As an added thought. Have a two step process. Before executing the "delete query". Have a button that enables the the "delete query" button. This will minimize accidentally executing the query.
 

Users who are viewing this thread

Back
Top Bottom