G
Guest
I would like to stop a macro if the user gets an Access error message.
In my case, I have a macro that imports data from Excel. If the user attempts to import data with a value in a key field that is already in the underlying table, he will get an Access error message, which is fine with me. (I have another macro that deals with that situation, one that uses an update query.)
If he does get such an Access message, I would like the macro to stop (or at least display my own message telling him to use the other macro), rather than the macro continuing on with a message telling him what a great job he did importing data, when in fact he hasn't.
In my case, I have a macro that imports data from Excel. If the user attempts to import data with a value in a key field that is already in the underlying table, he will get an Access error message, which is fine with me. (I have another macro that deals with that situation, one that uses an update query.)
If he does get such an Access message, I would like the macro to stop (or at least display my own message telling him to use the other macro), rather than the macro continuing on with a message telling him what a great job he did importing data, when in fact he hasn't.