Hi Guys
The below code doesn't update all the selected items in the listbox . It just loop through the first item multiple items. Can anyone please figure out what's going wrong here ? Thanks
The below code doesn't update all the selected items in the listbox . It just loop through the first item multiple items. Can anyone please figure out what's going wrong here ? Thanks
Code:
With Me.lstAllocation
For i = 0 To .ListCount - 1
If .Selected(i) Then
Set rs = CurrentDb.OpenRecordset("select * from tbl_RMS_MinStand_Mas_Allocation where AllocationID=" & Me.lstAllocation.Column(6) & "")
' MsgBox Me.lstAllocation.ItemsSelected(i)
'If Not (rs.BOF = True And rs.EOF = True) Then
With rs
.Edit
.Fields("MonthRef") = Me.cboMonthRef.Column(0)
.Fields("SupRef") = Me.cboSupervisor1
.Update
End With
Set rs = Nothing
.Selected(i) = False
End If
Next i
End With