previously Christian (Bitsqueezer) was helping me out with another question and then he mentioned about forms having public properties as a proper interface to go about things. that sparked off this thought of inheriting a particular form instance. here's what i wrote to him in that question but later decided to post it in a new question as i think the topics are different!
whao Christian! i didn't know we can use properties in the code behind class for forms! but like what you said before, forms and reports are special classes. hrmm. with that i can actually use Implements in a form's code behind class to specify that it must expose certain properties. hrmm. hrmm..
what do you think Christian, is it an extremely bad idea?
if i do something like
Dim frmChild As Class1
Set frmChild = Form_Form1
and i Form_Form1 implements Class1, immediately i lose all the other properties of the form.
so we're going into OOP (ok i know heaps of experts has castigated me on this haha - but hey, i'm just a developing programmer learning!! = )) ), and i need Form_Form1 to inherit from Form (which it is right now), and i also need it to implement the interface for Class1.
so Christian if i
Dim frmChild as Class1
and also put a variable pointing to Form_Form1 inside frmChild, then frmChild will implement Class1 AND also "inherit" Form_Form1 (through using the Implements keyword) right?
but 2 problems here.
1) i would have to manually implement every single sub and function of Form
2) the Interface class should NOT contain any code - which is why my programme kept on crashing previously and you taught me not to put any code in the interface class.
what is the right way to go about doing it?
thanks Christian!! = ))
P.S. i know i'll having to put in some mechanism to choose the form instance but that can be easily solved so am not focusing on that but rather the bigger and deeper issues of inheritance of a form instance and also about inheritance in VBA in general.
i've read a few articles but they all point to Implementing a class with code in it already - the big no no that caused all the headache for me previously
here's a link to a discussion with David Fenton and Steve Jorgensen on the topic too http://bytes.com/topic/access/answers/195390-faking-inheritance-vba-remove-code-duplication