Set the recordsource of the report to be the stored procedure. Then put the
parameter value you would like to pass in the Input Parameters. Remember,
if you're referencing a control on another form (which you are) you need to
specify that form's name.
Record Source: ip_rpt
Input Parameters: Forms!SomeForm!SomeTextbox
You may have noticed that when you run a report based on a parameterized sp,
the report will prompt you for those values before generating the report.
The Input Parameters property does that for you.
Andy-
> I have a stored procedure that I want to use for the
> record source of a form. I can put the record source in
[quoted text clipped - 3 lines]
> would be nice to get it from a form. I could then code a
> comanc button to open the report.
I never thought of that. I did it by putting the
RecordSource code in the Report module. I'll try your way
too. It looks more elegant.
Here's what I put in the mod:
Private Sub Report_Open(Cancel As Integer)
Dim cn As String
cn = Forms!frmOlderCaseJobOffer!txtCN.Text
Me.RecordSource = "Exec ip_rpt " & cn
End Sub
>-----Original Message-----
>Set the recordsource of the report to be the stored procedure. Then put the
[quoted text clipped - 20 lines]
>
>.