I want to store a structure in the tag field of a treenode.
I create the structure, assign values to variables in the structure and then assign the structure to the node. This all works great untill I want to change a value within the structure by access the node.
I get the error "Expression is a value and cannot be a target of an assignment" when I try the code below
CType(nde.Tag, SG_DATA).AllowableID = row.AllowableSpeciesID
and if I try the following ...
sgData = CType(nde.Tag, SG_DATA)
sgData.AllowableID = row.AllowableSpeciesID
At runtime the value of the AllowableSpeciesID is changed in structure object sgData but not in the node tag object. It seems as if I cannot get a reference to the stored object.
Is there something I am missing?
Any suggestions....




Reply With Quote