Question Why use Implements and WithEvents?

Guus2005

AWF VIP
Local time
Today, 16:57
Joined
Jun 26, 2007
Messages
2,636
I got this database application from a collegue and he uses Implements and in some cases WithEvents.

Searching for Implements gives me the explanation what it does. But what is not explained is when would you use it?
I have written perhaps a hundred Access applications without ever having to use the "Implements" keyword or "WithEvents" for that matter.

Am i missing some vital piece of information?

Grtz,
Guus
 
Sounds like he created event handlers in Access for a class object? Without seeing the code it's hard to tell. I see this in .NET often but never seen a purpose in Access VBA.
 
Impliments is used to add an interface to a class object. It makes the properties and methods of another class available without having to repeat the code.

Custom classes often have many of the same properties and methods as well as their own unique ones. Instead of adding the code for the common ones individually to each class they are put into a class of their own and that interface implimented to the other classes.

WithEvents is required to add custom events to a class object.
 

Users who are viewing this thread

Back
Top Bottom