I have a VBA function that is used in a query. The function is self validating using data entered on a form.
When validation fails I inform the user or take appropriate action.
This all works fine from code but if a user runs the query [e.g. from the query design mode], if there is a validation failure, I wish to stop the query running automatically.
This is important as the query can take a long time to run and might be started by a user ( not from the code) to run overnight and validation issues might not be located till user is tucked up in bed!
Please Note: There are other reasons why I do not really wish to control running code/macros from a switchboard, as well as wishing to run from the run button during design and test of the database/query.
Can this [stop/cancel] of the running query be done from code so that I can take other code action or stop altogether?
When validation fails I inform the user or take appropriate action.
This all works fine from code but if a user runs the query [e.g. from the query design mode], if there is a validation failure, I wish to stop the query running automatically.
This is important as the query can take a long time to run and might be started by a user ( not from the code) to run overnight and validation issues might not be located till user is tucked up in bed!
Please Note: There are other reasons why I do not really wish to control running code/macros from a switchboard, as well as wishing to run from the run button during design and test of the database/query.
Can this [stop/cancel] of the running query be done from code so that I can take other code action or stop altogether?