0
00eric claption
I put a parameter in select query and create a report which recordsource is
this query. Also write in code as the following suggested, but when I run
the following code. It keeps asking me the parameter value in the query even
after I set the theparametervalue = constant. Please help. THanks.
this query. Also write in code as the following suggested, but when I run
the following code. It keeps asking me the parameter value in the query even
after I set the theparametervalue = constant. Please help. 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]