Multiple Input Parameters

C

CSDunn

Hello,
I have an MS Access 2000 report called 'RptMM_StandardsGradeSummary' with
the Record Source property set to a SQL Server 2000 Stored Procedure. The SP
takes one parameter called @Location2.

The report is opened (by clicking a button) from two different forms in the
ADP application. I want to be able to use a Macro to determine the 'Input
Parameters' property of the report, based on the form button that is
clicked.

I've had trouble in the past with setting the Input Parameters property of a
report. The action of Buttons 1 and 2 will be to open the report. At some
point, the Input Parameter property of the report needs to be set to
'@Location 2 varchar = Forms!frmTeacherForm!location2' if Button_1 is
clicked, and '@Location 2 varchar = Forms!frmAdminForm!location2' if
Button_2 is clicked.

Which event for the Report do I want to assign the Macro to so that the
Input Parameter property gets set correctly?

Thanks for your help!

CSDunn
 
S

SA

CS:

With an Access 2000 ADP, there is simply no way to change the input
paramters on the fly at run time; you can only do that by opening the report
in design mode, change the InputParameters property, save the report and
then open it.

The simple work around would be to create a third form which each form
launches to gather the report's input paramters and have the report
reference that third form.

If you'd upgraded to Access XP or 2003, you could do this on the fly using
an Exec() command in the On Open Event as in:

Dim strRecordSource As String
strRecordSource = "Exec [YourStoredProcedure] 'ParameterValue1'
Me.RecordSource = strRecordSource

Where you set the parameter based on the form open at the time. However
Access 2000 does NOT support that method so the third form option will
probably work the best for your situation.
 
C

CSDunn

Thank you for your help!

CSDunn

SA said:
CS:

With an Access 2000 ADP, there is simply no way to change the input
paramters on the fly at run time; you can only do that by opening the report
in design mode, change the InputParameters property, save the report and
then open it.

The simple work around would be to create a third form which each form
launches to gather the report's input paramters and have the report
reference that third form.

If you'd upgraded to Access XP or 2003, you could do this on the fly using
an Exec() command in the On Open Event as in:

Dim strRecordSource As String
strRecordSource = "Exec [YourStoredProcedure] 'ParameterValue1'
Me.RecordSource = strRecordSource

Where you set the parameter based on the form open at the time. However
Access 2000 does NOT support that method so the third form option will
probably work the best for your situation.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

CSDunn said:
Hello,
I have an MS Access 2000 report called 'RptMM_StandardsGradeSummary' with
the Record Source property set to a SQL Server 2000 Stored Procedure.
The
SP
takes one parameter called @Location2.

The report is opened (by clicking a button) from two different forms in the
ADP application. I want to be able to use a Macro to determine the 'Input
Parameters' property of the report, based on the form button that is
clicked.

I've had trouble in the past with setting the Input Parameters property
of
a
report. The action of Buttons 1 and 2 will be to open the report. At some
point, the Input Parameter property of the report needs to be set to
'@Location 2 varchar = Forms!frmTeacherForm!location2' if Button_1 is
clicked, and '@Location 2 varchar = Forms!frmAdminForm!location2' if
Button_2 is clicked.

Which event for the Report do I want to assign the Macro to so that the
Input Parameter property gets set correctly?

Thanks for your help!

CSDunn
 

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