Dim StoreNoToUpdate As String
Dim Marsha As String
StoreNoToUpdate = \"ABCXYZ123\"
Marsha = \"hi\"
db.Execute \"Update TblLod
You need to get away from SQL concatenation and start using parameters.
Query with parameters:
PARAMETERS [prmMarshaCode] Text (50), [prmStoreNoToUpdate] Text (50);
UPDATE TblLodgingReport SET [MarshaCode] = [prmMarshaCode]
WHERE [Store Number ID] = [prmStoreNoToUpdate];
Calling the above query in VBA:
With CurrentDb().QueryDefs("qryName")
.Parameters("[prmMarshaCode]").Value = Marsha
.Parameters("[prmStoreNoToUpdate]").Value = StoreNoToUpdate
.Execute dbFailOnError
End With