Hi, I'm using a pass-through query in Access to trigger a stored procedure which is on my MSSQL server:
As this runs on the SQL server (because it's a pass -through query) I can't add a parameter to it.
I think it's possible to use VBA to build the SQL dynamically and therefore add the parameter but I don't know what code to use, or how to reference the results of the dynamically generated query from another (local) query?
To clarify, I have a select query which retrives some of it's data from linked tables that point to MSSQL, and some of it from the pass-through query detailed above.
I'd greatly appreciate any pointers...
Thanks!
http://www.scottwylie.co.uk
Code:
USE Raptor
DECLARE @return_value int
DECLARE @ActivityNumber int
EXEC dbo.SWACCESSResults @ActivityNumber = '140040024'
I think it's possible to use VBA to build the SQL dynamically and therefore add the parameter but I don't know what code to use, or how to reference the results of the dynamically generated query from another (local) query?
To clarify, I have a select query which retrives some of it's data from linked tables that point to MSSQL, and some of it from the pass-through query detailed above.
I'd greatly appreciate any pointers...
Thanks!
http://www.scottwylie.co.uk