J
JEM
Help! What is wrong with my code? I have a listbox that is supposed
to allow the users to select several items in the list and click a
button and it will add those items (contacts) to their record. But,
what is happening is that if i pick 3 different items, I get 3
records, but they are all the same item instead of the 3 different
ones. Any ideas on what's wrong with my code? Thanks for the help!
For i = 0 To Me.lstCaseContacts.ListCount - 1
If Me.lstCaseContacts.Selected(i) Then
rs.AddNew
rs.Fields("ClientID") = Me.OpenArgs
rs.Fields("ContactID") = Me.lstCaseContacts.Column(0)
If Me.lstCaseContacts.Column(9) <> "" Then
rs.Fields("OrganizationID") = Me.lstCaseContacts.Column(9)
End If
rs.Fields("ContactType") = Me.lstCaseContacts.Column(1)
rs.Update
End If
Next i
to allow the users to select several items in the list and click a
button and it will add those items (contacts) to their record. But,
what is happening is that if i pick 3 different items, I get 3
records, but they are all the same item instead of the 3 different
ones. Any ideas on what's wrong with my code? Thanks for the help!
For i = 0 To Me.lstCaseContacts.ListCount - 1
If Me.lstCaseContacts.Selected(i) Then
rs.AddNew
rs.Fields("ClientID") = Me.OpenArgs
rs.Fields("ContactID") = Me.lstCaseContacts.Column(0)
If Me.lstCaseContacts.Column(9) <> "" Then
rs.Fields("OrganizationID") = Me.lstCaseContacts.Column(9)
End If
rs.Fields("ContactType") = Me.lstCaseContacts.Column(1)
rs.Update
End If
Next i