Report based on SP w/ Parameter (Where does not work)

  • Thread starter Thread starter rm
  • Start date Start date
R

rm

I have a report based on a stored procedure. The stored procedure
contains 1 parameter, ID - long. I am trying to use docmd to open the
report an call the query. Each time I open the report I am prompted
for the ID.

The where condition on the docmd.open does not work ("[ID]="&
cstr(id)). I am still prompted for [ID].

How can I feed the stored procedure a paramter value in the open event
of the report.?
 
I have a report based on a stored procedure. The stored procedure
contains 1 parameter, ID - long. I am trying to use docmd to open the
report an call the query. Each time I open the report I am prompted
for the ID.

The where condition on the docmd.open does not work ("[ID]="&
cstr(id)). I am still prompted for [ID].

How can I feed the stored procedure a paramter value in the open event
of the report.?

Remove the criteria from the query so that the query returns all
records.

Then code a command button (on the form) click event:
DoCmd.OpenReport "ReportName", acViewPreview, , "[ID] = " Me.[ID]

where [ID] is the control on the form that displays the record ID you
wish to report on.
 
Back
Top