Re: Can a SQL Pass Through query use a parameter from a Form Control?



You can use a little DAO code like:

Dim strSQL as String
strSQL = "EXEC spYourSP '" & Forms!Form1]![Combo6] & "'"
CurrentDb.QueryDefs("qsptMySPT").SQL = strSQL


--
Duane Hookom
MS Access MVP

"woody" <woodywoodtucker@xxxxxxxxx> wrote in message
news:1162238110.296686.153750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a bit of a newbie question (basically stated in the subject of
the posting). If need to get some data out of a SQL Server Database.
Can I use a control from a form to supply a parameter. I've created a
stored procedure with the parameter I need, I just dont know how to
send the data from the form to the SPT query.

So I need to get data out of [Forms]![Form1]![Combo6] to my SPT query.
Can I do it?

Any help is greatly appreciated.

Thanks!



.



Relevant Pages