I program all reusable components into DLLs or OCXs. To provide a consistent error-handling technique across all my projects, I use the Raise method of the Err object in all these components and display the error only in the code module of first entrysuch as Command1_Click. Because an error can be generated several layers deep in the code, I propagate the location of the error using this Raise statement in all my reusable components:
Err.Raise Err.Number, "ThisProc" & vbCr & Err.Source
This way, the whole call stack is returned toand can be displayed inthe calling procedure (through Err.Source), making errors much easier to find and solve.