I am having a problem with the variable lastVic which can contains apostrophes.
The error appears when from the update statement.
I have read that I need to use double quotes but I don't understand where they quotes go exactly.Code:lastVic = DMax("LocationDescription", "Captures", "CatID = " & Me.CatID & " AND CaptureDate = #" & lastVicDate & "#") CurrentDb.Execute "UPDATE Cats SET LastVicinity = '" & lastVic & "' WHERE CatID = " & Me.CatID
Thanks!