0
-00Eric Clapton
I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?
parameter. How can I pass a parameter to report using the access code?
I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?
-00Eric Clapton said:OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.
OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.
John Vinson said:OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.
What's the context, Eric? Where is the parameter coming from?
One thing you could do, if the parameter is available within VBA but
not (readily) on a Form or other source, is actually construct the
Report's SQL string in code and set its Recordsource property to the
string.
Or, use the WhereCondition parameter of OpenReport:
Dim strSQL As String
strSQL = "[fieldname] = " & TheParameterValue
DoCmd.OpenReport "rptMyReport", WhereCondition := strSQL
John W. Vinson[MVP]