When I use this 'Set Class1 = Class2' if the same 2 objects are the same class it works, but then if I change the first one.. The second one changes to.
How do I copy all the information in the same manor, but keep
the indepenance for each class?
Printable View
When I use this 'Set Class1 = Class2' if the same 2 objects are the same class it works, but then if I change the first one.. The second one changes to.
How do I copy all the information in the same manor, but keep
the indepenance for each class?
You need to create a new instance of the class and then set each property manually. Typically accomplished by creating a Copy method in your class
Something like
VB Code:
'Class 1 Public Function Copy() as Class1 Set Copy = new Class1 With Copy .Property1 = me.Property1 .Property2 = me.Property2 .Property3 = Some Default value End With End Function