I have a access form with two list boxes called Available and Chosen the Available list box is populated with 3 fields (Agcno (number), Agency(text) & State(text) from the table TBLAgency. When a record is selected from the Available listbox and added to the Chosen listbox I would like to update a field called Flag1 for the selected record in my table with a "false" value. I have used the following vba code which works fine in another database using a single field listbox but is erroring out on the query using the 3 fields listbox.
Private Sub Add_Click()
If Available.ItemsSelected.Count = 1 Then
CurrentDb.Execute ("UPDATE TBLAgency SET TBLAgency.FLAG1 = False " & _
"WHERE TBLAgency.AGCNO AND TBLAgency.AGENCY AND TBLAgency.CITY ='" & Available & "';")