The basic purpose of withevents is to access the events associated with a object.
There are instances when you want to customise existing controls for your needs, you add some additional events in your control by wrapping up existing controls.
These events can be accessed if a variable is defined with "withevents".
You dont declare a procedure with withevents.
It is use with variable/instances to get the events associated with the object.
I tell you a simple demo
Try this out in a project having reference to ADO library and see the differnce in the object & events list box
Dim rs As ADODB.Recordset
Dim WithEvents rs1 As ADODB.Recordset
You should see rs1 in the objects list and you will be able to handle events associated with it.
Best Luck..
Nilesh