I want to run an update query on all records in a list box. My code kind of looks like this:
Private Sub AssignButton_Click()
Dim SQLMasterUpdate As String
Dim oItem As Variant
If Me!RestaurantListBox.ItemsSelected.Count <> 0 Then
For Each oItem In Me!RestaurantListBox.ItemsSelected
SQLMasterUpdate = "(This is the part I'm struggling with !)"
DoCmd.RunSQL SQLMasterUpdate
Next oItem
Else
MsgBox "Nothing was selected from the list", vbInformation
Exit Sub 'Nothing was selected
End If
End Sub