I am wondering if this is possible. I have a List Table (lstTable) that is on the same form that I am trying to fill in with information from a public structure (ELEM_DATA). I understand nested with statements will work if it is within the same scope but how can I do this with example 2 below:
Example 1:
With me.lstTable.Items(RECORD)
.SubItems(1).text = ELEM_DATA(RECORD).name
.SubItems(2).text = ELEM_DATA(RECORD).number
end with
Example 2:
With me.lstTable.Items(RECORD)
With ELEM_DATA(RECORD)
.SubItems(1).text = .name
.SubItems(2).text = .number
end with
end with
I didnt know if it is possible or if it would be as simple as changing (.name) to something else.
Nested With statements work (see comment about conflicts). Unfortunately you can't use the outer members inside the inner with. But since your outer WITH is a refernce type you could use a local variable to "alias" it as you suggest in you comment.
Here's a link to show how nested WITH statements can used.
http://ideone.com/agjne