I have a multi select list box on a form that is used to choose items from a past report and add them to a current report.
There is a button that adds everything that is selected in the list box to a table, and then a second list box is updated with the information.
Everything works fine, but I need the selected items in the first list box to be cleared when the user clicks the button (btnAddSelected).
I am using
right now, but it is clearing the information that is added to the second list box.
Do I just have this command in the wrong place?
Private Sub btnAddSelected_Click()
Dim frm As Form
Dim ctl As Control
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim i As Variant
Set frm = Forms("frm_Act_Enter")
Set ctl = frm![lstPrevRpts]
Set db = CurrentDb
Set rst = db.OpenRecordset("Act_SubTo_Date")
For Each i In ctl.ItemsSelected
' Debug.Print i, ctl.Column(4, i)
rst("ActID") = ctl.Column(4, i)
rst("ActDate") = Nz(Me!ActDate.Value, Date)
Me.lstPrevRpts.Selected(i) = False
Set rst = Nothing