What was the exact error message? My guess would be that you have put the code in a Module or a Class, but it should actually be in the Form's module.
Just for clarity, what you actually wrote was still a parameterised query. The red bits indicate that it is -->
Parameterised in the sense that you are reference a control from within the SQL statement.
Yes, I did put the code in a Module, and run it as a Function!
Does it make any difference within a Form's module?
rabbit