Unanswered: Update Query built from a Multi Listbox
It works great except, unable to get the same selected individual to update, and it's usually my first record, until I delete it then it becomes another record
Here's what am trying to do...
Multi-listbox contains a list of people I want to group together by assigning a number. I enter a number in a text box, select the people and click a button with the following code. All works great, except one selection (and it's the same selection every time) cannot be assigned for some reason.
Any assistance would be appreciated. Thanks in advance.
Here's the code:
' Declare variables
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strSQL As String
' Get the database and stored query
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryMultiSelect")
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
' Loop through the selected items in the list box and build a text string
If Me!NamesList.ItemsSelected.Count > 0 Then
For Each varItem In Me!NamesList.ItemsSelected
strCriteria = strCriteria & "tbl_Famliy_Members.Shooter_ID = " _
& Me!NamesList.ItemData(varItem) & "OR "
If Len(strCriteria) = 0 Then
MsgBox "You did not select anything from the list" _
, vbExclamation, "Nothing to find!"