MsgBox: only if macro succeeds

  • Thread starter Thread starter John Hipskind
  • Start date Start date
J

John Hipskind

My macro imports Excel files, and works fine (thanks to
help from you guys).

I would like users to know the process was successful by
including a MsgBox at the end of the macro.

However, if the user tampers with the templates, or
repeats a number in the table's key field, Access will
stop the process with an error message--but after
cancelling out of that message, the macro will continue
and my MsgBox informs users that the data was imported,
when in fact it was not.

How can I have MsgBox test for an Access error message,
and display "Data successfully imported" only if the
macro is successful?

Thanks.

John
 
Hi,
I beleive you have to resort to VBA for this.
Macros do not have error trapping so there's no way
to trap an error and inform your user that the whole process
failed.
 
Back
Top