Run-time error

R

Rob A.

I am currently implementing a macro that prompts the user
for a source and a destination to be copied to. In the
case that the user gives a destination that is already in
use, I do not want the copy to occur and a form should pop
up warning them of the mistake. Everytime a proper and
clear destination is given, I get no errors. However,
when I enter an occupied space as the destination for the
data, I get an error stating {Run-time error '2001': You
canceled the previous operation.} The functionality of
this macro is sound ... it works fine and the data is not
overwritten. I would like, though, to be able to get rid
of this error box (which prompts whether you want to End
or Debug the error). Any suggestions?

Thanks in advance!

Rob A.
 
V

Van T. Dinh

This is one of the major drawbacks (if not THE major drawback) of Macros
compared with VBA: you cannot trap and manage / ignore the error.

If you use VBA code, you can easily trap and ignore this error and other
errors.

See Access VB Help on error-trapping.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top