papadilbert
New member
- Local time
- Today, 02:57
- Joined
- Nov 29, 2011
- Messages
- 8
To play with writing an interface and implementation I wrote a simple example. The interface "clsSimple" has a field that I named pCustomerName and defined is as String. I created the Public Get and Set properties for CustomerName and wrote no code for them since they would be implemented in the child class.
I created the child class, a form, starting it with "Implements clsSimple".
I coded properties for Get and Set of clsSimple_CustomerName that store and retrieve the string stored in pCustomerName
I coded a subfunction that is invoked by a form button click.
In the subfunction I specified:
Set objSim = new clsSimple
objSim.CustomerName = "George"
Debug.Print objSim.CustomerName
Nothing prints. I stepped through the code during execution and found that the parent Get and Set are being executed instead of the "implemented" Get and Set.
Where have I gone wrong?
I created the child class, a form, starting it with "Implements clsSimple".
I coded properties for Get and Set of clsSimple_CustomerName that store and retrieve the string stored in pCustomerName
I coded a subfunction that is invoked by a form button click.
In the subfunction I specified:
Set objSim = new clsSimple
objSim.CustomerName = "George"
Debug.Print objSim.CustomerName
Nothing prints. I stepped through the code during execution and found that the parent Get and Set are being executed instead of the "implemented" Get and Set.
Where have I gone wrong?