Just FYI, per MSDN
Edited. One of my biggest "abuses" of WITH is for loading properties on some controls and recordsets, especially listviewsNote: Once a With block is entered, object can't be changed. As a result, you can't use a single With statement to affect a number of different objects.
You can nest With statements by placing one With block within another. However, because members of outer With blocks are masked within the inner With blocks, you must provide a fully qualified object reference in an inner With block to any member of an object in an outer With block
In general, it's recommended that you don't jump into or out of With blocks. If statements in a With block are executed, but either the With or End With statement is not executed, a temporary variable containing a reference to the object remains in memory until you exit the procedure.
Code:With ListView1.ListIems.Add(, , , "Main Item Text") .SubItems(1) = ... .SubItems(2) = ... ... etc End With




Reply With Quote
