Harry Covair
Member
Hi the forum,
A variable is defined as Static in a main procedure. To use it in another procedure, I put the name as a parameter between the parentheses after the name of the procedure in both the call and the sub.
But when I try to use the static variable in a event procedure, VBA gives an error message.
The question is: is it possible to use a static variable defined in the main procedure in an event procedure as "Click" or "Change"?
Example
Could a member of the forum advise me to solve this problem?
Thanks in advance
Harry
A variable is defined as Static in a main procedure. To use it in another procedure, I put the name as a parameter between the parentheses after the name of the procedure in both the call and the sub.
But when I try to use the static variable in a event procedure, VBA gives an error message.
The question is: is it possible to use a static variable defined in the main procedure in an event procedure as "Click" or "Change"?
Example
Code:
Sub Main()
Static num_quest as long
blabla
Call analyze(num_quest)
End sub
------------------
Sub analyze(num_quest)
blabla
End sub
-------------------
Sub combo_Change(num_quest) '<--------------not allowed
Could a member of the forum advise me to solve this problem?
Thanks in advance
Harry