Update only selected records in the list

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
 
H

HKComputer via AccessMonster.com

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top