Remember that this method doesn't work with all RecordSourceType values in the list box. In fact it only works when RecordSourceType = 0 or 1 (None or Value).
May be you try to use another control for your task?
Take a glance at TreeView ActiveX.
You can populate it with simple set of data or data from tables.
It's extremely simply. For your task you can set checkboxes for every node in tree and check them either manually (user choice) or programmatically.
For example:
With this
.Nodes.Add(,,"a","First node"
.Nodes.Add(,,"b","Second node"
.Nodes.Add(,,"c","Third node"
.Nodes.Add(,,"d","Fourth node"
.Nodes.Add(,,"e","Fifth node"
Endwith
Delete node from tree
this.Nodes.Remove("b"
Check All node
For i=1 TO This.Nodes.Count
This.Nodes.Item(i).Checked=.T.
Endfor
Delete checked node from tree
If This.Nodes.Item("a".Checked
This.Nodes.Remove("a"
Endif
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.