I commonly recommend you use a QueryDef, and this is no exception. It's more verbose in code terms, but simpler to understand the SQL, easier to see where each parameter value is being assigned, and delimiters are not your problem.
Consider code like...
Public Sub logging(Activity As String...