Object related errorcode

  • Thread starter Thread starter frank knuckles
  • Start date Start date
F

frank knuckles

I often see this kind of code:
Exit_btnOK_Handler:
Exit Sub
Err_btnOK_Handler:
MsgBox Err.Description
Resume Exit_btnOK_Handler

While the following generic code is easier to use in other subs or
functions:
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Handler

What's best to use?
Thanks.

FK
 
Not sure you can really say one's better than the other.

I believe labels needed to be unique in Access Basic, so that the first
option was mandatory. Now that labels only need to be unique in their
procedure, there's no reason not to use the second option. They both do
exactly the same thing, though.
 
Thanks Douglas.

Douglas J. Steele said:
Not sure you can really say one's better than the other.

I believe labels needed to be unique in Access Basic, so that the first
option was mandatory. Now that labels only need to be unique in their
procedure, there's no reason not to use the second option. They both do
exactly the same thing, though.
 

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

Back
Top