What was puzzling me, was an almost identical piece of code was working fine a few lines above. Anyway I eventually figured out the the parameter names are pretty much irrelevant when using an Access database, but it’s important the order matches the query. So simply moving one line of code fixed the problem.