Message 1 of 5
Class objects in two collections
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
At one point in my application I have two collections which initially are identical ... they are both initiated and filled from records in a csv file within a single procedure. The content of each collection are class objects.
The idea is that one of these collections is intended to be untouched by my application. The other is a working copy which my application (and the user) edits as well as adds new objects. The purpose for the pristine copy is for comparison only so that my application can determine if the objects properties have changed from there initial value.
The problem I am having is that when my application edits the working copy... the pristine copy which isn't to be edited changes.
I have given specific variable names to the objects taken from the working copy which are edited. I set that variable name to the item from the working collection and edit it's properties. The props change correctly... but the matching object found in the pristine copy also changes but should not.
Why might this be happening?
The code is large so I don't see that it would be possible to show my code... and admittedly, I am still cutting my baby teeth on VBA beginning with this app - so please go easy on me.
The idea is that one of these collections is intended to be untouched by my application. The other is a working copy which my application (and the user) edits as well as adds new objects. The purpose for the pristine copy is for comparison only so that my application can determine if the objects properties have changed from there initial value.
The problem I am having is that when my application edits the working copy... the pristine copy which isn't to be edited changes.
I have given specific variable names to the objects taken from the working copy which are edited. I set that variable name to the item from the working collection and edit it's properties. The props change correctly... but the matching object found in the pristine copy also changes but should not.
Why might this be happening?
The code is large so I don't see that it would be possible to show my code... and admittedly, I am still cutting my baby teeth on VBA beginning with this app - so please go easy on me.