Passing Parameter from Form to Report

  • Thread starter Thread starter Drew
  • Start date Start date
D

Drew

I need to pass 2 parameters from a form to a report that is generated by a
Stored Procedure. I have a form built with 2 dropdowns, one for Employee
Title the other for Employee Status, and a button. When the user selects
the title and status they want in the report, I want them to click Get
Report and then the report is generated by a SP (in SQL Server) where the
params are given by the form.

Is this possible?

Thanks,
Drew
 
In the Input Parameters of the report, you can refer to the form and
control. In this example I am refering to the form "QT_Quates" and the
control QuoteID

@QuoteID DECIMAL(10,2) = Forms("QT_Quotes")!QuoteID

Jim
 
So how is this supposed to work? Does it execute the form when the report
is executed? Also, how would I set 2 parameters? Like this?

@EmpTitle varchar(50) = Forms("Title")!ddlEmpTitle; @EmpStatus varchar(50) =
Forms("Title")!ddlStatus

Thanks,
Drew
 
Use a comma instead of a semicolon.

@EmpTitle varchar(50) = Forms("Title")!ddlEmpTitle, @EmpStatus varchar(50)
= Forms("Title")!ddlStatus

This is assuming that the form is open and the fields you are looking at are
populated with the required info. You will probably want to do some
validation before the report is opened. On open, the report runs the stored
procedure using the input parameters defined. This allows it to be very
fast as the server is doing all of the filtering rather that the Access
client.

Jim
 
-----Original Message-----
I need to pass 2 parameters from a form to a report that is generated by a
Stored Procedure. I have a form built with 2 dropdowns, one for Employee
Title the other for Employee Status, and a button. When the user selects
the title and status they want in the report, I want them to click Get
Report and then the report is generated by a SP (in SQL Server) where the
params are given by the form.

Is this possible?

Thanks,
Drew


.
so
 
Back
Top