Passing Parameter from Form to Report

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
 
J

J. Clay

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
 
D

Drew

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
 
J

J. Clay

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
 
W

wong wei wha

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top