Bullsandbears123
Technical User
I need to set a parameter value and open a report in ACCESS with VB.
I have a SQL statement
SELECT field1 FROM table1 WHERE field1=[input]
I need to pass a value into [input] when I open the query to run a report. Any idea of how to do this. Should I be using dynamic SQL, something like
SELECT field1 FROM table1 WHERE field1=?
or
SELECT field1 FROM table1 WHERE field1=@input
I never used dynamic SQL so I do not know how to reference the parameter any idea will help a bunch.
THANKS
PS. I know query1.[input]=5 does not work.
I have a SQL statement
SELECT field1 FROM table1 WHERE field1=[input]
I need to pass a value into [input] when I open the query to run a report. Any idea of how to do this. Should I be using dynamic SQL, something like
SELECT field1 FROM table1 WHERE field1=?
or
SELECT field1 FROM table1 WHERE field1=@input
I never used dynamic SQL so I do not know how to reference the parameter any idea will help a bunch.
THANKS
PS. I know query1.[input]=5 does not work.