I have the following code which uses the update statement to update data in a table for the items which are selected in a listbox on a form, which works fine. My problem is after the data is updated, how do I refresh the listbox? I tried putting me![listbox].Requery after the loop, but it doesnt work. At the moment I have to have to set the timer interval to about 10 seconds, the do the requry bit in there, which works, but how do I get it to requery only after the data has updated? I tried putting it in just before the Next statement so it would update everytime it looped thru the selected items, but that also didn't work.
For Each varDrgNo In ctl.ItemsSelected
dbs.Execute "UPDATE [TBL_Drawings] " _
& "SET Issue = 'I' " _
& "WHERE DrawingNo = """ & ctl.ItemData(varDrgNo) & """;"
Next varDrgNo
For Each varDrgNo In ctl.ItemsSelected
dbs.Execute "UPDATE [TBL_Drawings] " _
& "SET Issue = 'I' " _
& "WHERE DrawingNo = """ & ctl.ItemData(varDrgNo) & """;"
Next varDrgNo