Help on VBA Code to Activate Action Queries

%3CLINGO-SUB%20id%3D%22lingo-sub-1490046%22%20slang%3D%22en-US%22%3EHelp%20on%20VBA%20Code%20to%20Activate%20Action%20Queries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1490046%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20creating%20an%20access%20database%20in%20which%20there%20are%203%20tables%3A%20Current%2C%20Last%2C%20and%20Totals.%20I%20have%20created%203%20action%20queries%20that%20will%3A%3C%2FP%3E%3CP%3E1.%20Append%20the%20total%20amount%20from%20a%20currency%20field%20in%20%22Last%22%20to%20the%20%22Totals%22%20table.%3C%2FP%3E%3CP%3E2.%20Delete%20all%20Records%20in%20%22Last%22.%3C%2FP%3E%3CP%3E3.%20Append%20all%20Records%20from%20%22Current%22%20to%20%22Last%22.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20these%20action%20queries%20to%20activate%20on%20a%20monthly%20basis%20and%20was%20wondering%20if%20there%20is%20a%20way%20i%20could%20code%20the%20database%20to%20run%20the%20action%20queries%20automatically%20on%20a%20specified%20day%20of%20the%20month%2C%20or%20if%20the%20only%20way%20for%20this%20to%20happen%20is%20for%20them%20to%20be%20triggered%20manually%20by%20the%20user%20through%20a%20form%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1490046%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1491679%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20on%20VBA%20Code%20to%20Activate%20Action%20Queries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1491679%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F710491%22%20target%3D%22_blank%22%3E%40EBriley%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFYI%2C%20such%20an%20approach%20will%20lead%20to%20bloating.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20for%20your%20question%2C%20you%20could%20create%20a%20macro%2C%20and%20then%20create%20a%20Windows%20Scheduled%20Task%20that%20runs%20the%20%2Fx%20command%20line%20switch%20to%20run%20the%20macro%20on%20the%20given%20day%2Ftime%20of%20your%20choosing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Hello, 

 

I am creating an access database in which there are 3 tables: Current, Last, and Totals. I have created 3 action queries that will:

1. Append the total amount from a currency field in "Last" to the "Totals" table.

2. Delete all Records in "Last".

3. Append all Records from "Current" to "Last". 

 

I would like these action queries to activate on a monthly basis and was wondering if there is a way i could code the database to run the action queries automatically on a specified day of the month, or if the only way for this to happen is for them to be triggered manually by the user through a form?

1 Reply
Highlighted

@EBriley 

FYI, such an approach will lead to bloating.

 

As for your question, you could create a macro, and then create a Windows Scheduled Task that runs the /x command line switch to run the macro on the given day/time of your choosing.