Update only selected records in the list

  • Thread starter Thread starter Victoria.sv
  • Start date Start date
V

Victoria.sv

Please could somebody help me with my problem. I have list box in the
form, the sourse of that list is SQL query. I would like to update
only selected records in that list ( multiple) and my code is
following:

For intItem = 1 To Form_InCheck.List4.ListCount - 1
If Form_InCheck.List4.Selected(List4.ListIndex) = 0 Then
With rs
.Edit
.Fields("Supplied") = True
.Update
.MoveNext
End With
End If
Form_InCheck.List4.Requery
Next intItem

If I stop running on NEXT the first record is updated if I select it
and stay the same if was not selected ( so that's what I want), but if
I let the code run to end All record become updated with no difference
were they selected or not.

Please can anybody help me?
Thanks a lot!
Victoria
 
I'm not real familiar with this either but I think your code loops and
bypasses your if statement. It only passes through the if statement the
first time around.
 
Back
Top