Hi there,

I'm selecting multiple records
in a listbox which is based on a query. I'm then attempting to update a
particular field in all selcted items

Unfortunately I can't get it to update multiple selected records. It
will only update the first selected and ignore any others. (I've tried
various looping strategies to no avail)

Using extended multiselect properties on the list box - it only seems to
recognise only the first selected item and no others subsequent to that

Any ideas? My Code is below

Cheers and TIA

Private Sub update_despatchdate()

If EnterDespatchDate.Text = "" Then
MsgBox "Please enter a Despatch date"
Exit Sub
End If

Dim rst As ADODB.Recordset

Dim varItem As Variant
Dim strList As String
Dim strCriteria As String
Set rst = New ADODB.Recordset

With rst
Set .ActiveConnection = CurrentProject.Connection
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open "t:anzlist", Options:=adCmdTableDirect

For Each varItem In AddressList.ItemsSelected
strList = strList & AddressList.Column(11, varItem)

strCriteria = "[id]='" & strList & "'"

.Find strCriteria

If Not .EOF Then
.Fields("DespatchDate") = EnterDespatchDate.Value
End If
Next varItem

End With
Set rst = Nothing

End Sub