Macro when query closes

radshar

Registered User.
Local time
Today, 03:55
Joined
Aug 5, 2016
Messages
32
Hi,

I have a form which has a button which opens a query using this code:
Code:
DoCmd.OpenQuery "Find duplicates for Pending Report - Cumulative", acViewNormal, acEdit

The user will do a set of actions. I want for the following code to be run when the query is closed. is this possible?

Code:
DoCmd.OpenQuery "Append duplicates to Recurrent Records"
DoCmd.OpenQuery "Delete the appended records to Recurrent rc from cumul"

This is to remove the records which had a specific action taken. they are moved to another table and then deleted.

thanks,
 
regret not because closing a query does not generate an event to trigger the actions you require.

You would need to use a form which uses the query as its recordsource then use the forms close event to run your code
 
thanks for that!

I was able to find another way...instead of Onclick of the button, i'm running it onExit...seems to work :)
 

Users who are viewing this thread

Back
Top Bottom