How do you reuse modified controls?

sync

Registered User.
Local time
Today, 10:49
Joined
Jan 9, 2006
Messages
14
I was amazed to discover that a copied control does not contain the event code in the original control. How do reuse these controls?
 
Same thing (maybe depends on version) if you rename a control with VBA behind it, it loses the VBA on that control (although the VBA is still there).
 
a copied form will retain the original code-behind-form. but i think copying and pasting is the only way to reuse the code from a copied control that is on a form. (rename the new control first).
 
i don't suppose there's much point in having two controls that do exactly the same thing. out of curiosity, when would it be most useful?
 
wazz said:
i don't suppose there's much point in having two controls that do exactly the same thing. out of curiosity, when would it be most useful?

Good point, why not just make that as a public function and call it from where ever you need to.
 
wazz said:
i don't suppose there's much point in having two controls that do exactly the same thing. out of curiosity, when would it be most useful?
How about a control that lets the user increment/decrement a date with the plus/minus keys?
 
sync said:
How about a control that lets the user increment/decrement a date with the plus/minus keys?
Then the two buttons aren't doing the same thing, are they?
 
It is a bit of an annoyance.
1. Copy and paste the control.
2. Change the Name of the control to something meaningful.
3. Copy the code without the sub header/footer.
4. In the property dialog for the new control, press the three dots to create code for the event.
5. Paste the code into the created shell sub.
 

Users who are viewing this thread

Back
Top Bottom