Databases Reference
In-Depth Information
FIGURE 8.9 Selected records for deletion.
Private Sub Button_Remove_Click()
'Remove Selected Items from Chosen Listbox
Dim index As Integer, DeletedItems As Integer
Dim allrow As Integer
On Error Resume Next
For index = 0 To frm7Bind.ListBox_Chosen.ListCount - 1
If frm7Bind.ListBox_Chosen.Selected(index - DeletedItems )
= True Then
ListBox_All.AddItem 'Add next row to list
'Track Items that have moved, 0 = not selected, else
set to position + 1
ReDim Preserve dBptr(index)
dBptr(index) = index + 1
'Next added Row Number
allrow = ListBox_All.ListCount - 1
If allrow < 0 Then allrow = 0
For col = 0 To frm7Bind.ListBox_Chosen.ColumnCount - 1
'ListBox_All.AddItem oRecordSet.Fields(strDBField)
'Debug.Print oRecordSet.Fields(2)
frm7Bind.ListBox_All.List(allrow, col) =
frm7Bind.ListBox_Chosen.List(index - DeletedItems, col)
Search WWH ::




Custom Search