I am revamping some older code to work with some mail merge automation I set up between MS Access and MS Word, and all works great except one single query. One of the automation functions I designed allows the programmer to pass the name of an access query to the function, which in turn opens MS Word and allows word to connect to the database to receive the query results. The query that is not working is retrieving a value from a hidden form, and I know there is a way to instead pass the value as a parameter to the access query. I like to stick to SQL Server Stored Procedures, so I don't recall how to do this.
When this is run using Access there is no issue, however when run through automation the parameter is not recognized. Can I instead pass the value? Any help is appreciated, I just need an example.
Thanks!
Code:
SELECT Column1, Column2
FROM tbl_Table
WHERE (Column1 = [Forms]![Hidden Codes]![cr code])
When this is run using Access there is no issue, however when run through automation the parameter is not recognized. Can I instead pass the value? Any help is appreciated, I just need an example.
Thanks!