evanscamman
Registered User.
- Local time
- Today, 05:16
- Joined
- Feb 25, 2007
- Messages
- 274
Is there any way to refer to a variable in a Form without literally spelling out its name - through a collection perhaps?
For example:
I am using a class module to handle multiple instances of a subform in the same form.
From a control in the subform I need to call a Function in the class module:
The subform is peppered with similar calls to the class module - but, of course, the calls only reference the first instance of the subform.
Without duplicating tons of code, I need a simple way to alternately refer to basIF or basIF2. Something like this:
Of course, this doesn't work, but I'm hoping there is a way to do this without nasty code duplication. I don't think an array will do it either...
Any ideas? Is this possible?
Thank you,
Evan
For example:
I am using a class module to handle multiple instances of a subform in the same form.
Code:
Public basIF As New basItemFind '1st Instance for sfrmPurchaseOrderQueue
Public basIF2 As New basItemFind '2nd Instance for sfrmPurchaseOrderItem
From a control in the subform I need to call a Function in the class module:
Code:
Parent.basIF.IF_LostFocus
The subform is peppered with similar calls to the class module - but, of course, the calls only reference the first instance of the subform.
Without duplicating tons of code, I need a simple way to alternately refer to basIF or basIF2. Something like this:
Code:
strClassName = "basIF2"
Parent.Variables(strClassName).IF_LostFocus
Of course, this doesn't work, but I'm hoping there is a way to do this without nasty code duplication. I don't think an array will do it either...
Any ideas? Is this possible?
Thank you,
Evan