05-18-2017 12:59 PM
Perhaps try taking the carriage returns out of the SQL select statement.....
05-18-2017 01:05 PM
Just tried it with no carriage returns - just one line. I get the same error.
05-18-2017 04:04 PM
Are you sure that your first column name is a valid name?
Try to remove that from the SQL statement..
05-18-2017 04:09 PM
Good call. So the column name can't begin with a number?
05-19-2017 07:46 AM - edited 05-19-2017 07:57 AM
It appears that the @ symbol is not needed if you are accessing an Access 2016 database. It also appears that enclosing the parameter in the sql statement isn't a must. I don't know if this is true for earlier versions of Access. These parameterized Access 2016 database queries work for me. It appears that my problem was starting a column name with a number. Also, I believe if the column name has spaces in it, you need to put the column name in square brackets (e.g. [First Sample ID]).
Thanks everyone for the help and for posting the initial solution. I would still be trying to figure this out if it wasn't for the help.
05-23-2017 03:01 PM
Sorry for the multiple posts.
Even this works with parameterized sql queries to Access 2016 databases.
05-23-2017 05:29 PM
One of the things to remember is that parameterized queries are not standardized between platforms: everyone does it different and as in the case of Microsoft can change it at anytime.