Hey! Long time no posting hereSo here i go.
Im just want to pass a variables reference to a class, then im want to change the referenced variables value later, outside the subroutine there i passed the variable to.
Here is my idea, im seeking for any workaround.
The problem is in the class.Code:'In a module: Global myVarAutomated as long 'In a form: Private clsObj as myClassObj Private Sub Form_Load() Set clsObj = new myClassObj clsObj.Init myVarAutomated 'passing the reference clsObj.IncValue 10 'Increase the value by 10 msgBox myVarAutomated 'Now at this point im want to display the value of the variable that increased before. :) End Sub
No it isnt works.. but how can i get it to work?Code:Private AutomatedValue 'as any, or what? Sub Init(ByRef aVal) Set AutomatedValue = aVal End Sub Sub IncValue(ByVal lVar as long) AutomatedValue = AutomatedValue + lVar End Sub
Thanks
J




So here i go.
Reply With Quote