Passing Variables

What would be the best way to handle passing variables andvalues between userforms in a SW VBA macro.

Thanks,
Declan.SolidworksApi macros
Comments 3
CC
CC 2008-06-27
in form1 declare the variable as global ex. Test
and in form2 you can call the variable from form1: form1.test
Chris
SF
SF 2008-06-27
For best programming practise your main code function shouldcreate an instance of Form1, show it, and after it has returned,get the variables (that are set as public not global) and do as youplease with them. Then the main code continues and creates aninstance of Form2, and then sets public variables within Form2 tothose values you just retrieved from Form1.
SF
SF 2008-06-27