- Local time
- Today, 09:55
- Joined
- Feb 28, 2001
- Messages
- 27,003
Here's a hint for you then. If you write a common subroutine in a general module, the greatest danger to program integrity (and the greatest threat to causing you to tear your hair out) is to forget that from a common subroutine, NOTHING on the calling form is local.
There are two approaches to this problem.
1. Make every control you intended to touch be a call parameter. This means a LOT of parameters in some cases. Doable but can be a bit tedious to write out the call.
2. Make every form that would need to call this function use the same names for corresponding controls, then pass the FORM as an argument and let it use that knowledge of the common structure to find each of the controls by that commonly used name.
There are two approaches to this problem.
1. Make every control you intended to touch be a call parameter. This means a LOT of parameters in some cases. Doable but can be a bit tedious to write out the call.
2. Make every form that would need to call this function use the same names for corresponding controls, then pass the FORM as an argument and let it use that knowledge of the common structure to find each of the controls by that commonly used name.