Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass value to parameter

Status
Not open for further replies.

Bullsandbears123

Technical User
Feb 12, 2003
291
0
0
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top