looping through all items in a list box

dimanche 5 avril 2015

hi all.



I'm struggling with what is probably a very simple solution, and would like some help.



I have managed to amend records based on the user selecting multiple items in a list box by using the following code.



Set db = CurrentDb()

Set rs1 = db.OpenRecordset("Usage", dbOpenDynaset, dbAppendOnly)







Set ctl = [Forms]![frmsearch]![lstSelector]

For Each varItem In ctl.ItemsSelected

rs1.AddNew

rs1!ID = ctl.ItemData(varItem)

rs1!UsageDate = Me.txtDate

rs1!PlanReturnDate = Me.txtplanReturn

rs1!District = Me.lstDistrict

rs1!Notes = Me.txtnotes

rs1.Update



what I need to do now, is to loop(I think) through and amend all the records in a populate listbox, with no selections, similar to above, but without selection.



would really appreciate any help you could give.



thanks in advance

looping through all items in a list box

0 commentaires:

Enregistrer un commentaire

Labels