-----Original Message-----
Using an Exit label gives you a single point of exit. Generally, that's a
good idea, unless your code is using a loop. Then it makes sense to exit the
loop once the condition as been satisfied, rather than completing the loop.
Also, the Exit label usually does more than simply exit the sub or function.
It provides a method to close and release object variables. Consider:
Exit_Here:
rst.Close
Set rst = Nothing
Set db = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here
The above makes sure that the recordset variable is closed and that both it
and the database variable are released (set to nothing). Simply exiting the
sub on the error handler wouldn't do that.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
.