I don't understand which part of this statement is an attempt to update a query. I am trying to update the Restaurant table. The WHERE clause references a list box that contains a query.
Private Sub AssignButton_Click()
Dim SQLMasterUpdate As String
Dim iRow As Variant
If Me!RestaurantListBox.ItemsSelected.Count <> 0 Then
For Each iRow In Me!RestaurantListBox.ItemsSelected
SQLMasterUpdate = "UPDATE Restaurant SET " & _
"Restaurant.AccountManagerID = (SELECT AccountManagerID FROM AccountManager " & _
"WHERE AccountManagerName = " & Me!NameComboBox.Value & ")" & _
"WHERE ((SELECT RestaurantPhone FROM Restaurant) = " & _
Me!RestaurantListBox.Column(1, iRow) & ");"
DoCmd.RunSQL SQLMasterUpdate
Next iRow
Else
MsgBox "Nothing was selected from the list", vbInformation
Exit Sub 'Nothing was selected
End If
End Sub