prompt parameters for report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like a parameter pop-up to appear when a particular report is run.
How do I do that?

For example, I have a report based on a crosstab query. I want the report
to only show the results from the query for a selected date. I want the date
specified when the report is run.

Thanks
 
Hi,

Depends on how you're opening your report. If you are using a form based
interface to open reports, you could use the Docmd.OpenReport method along
with the wherecondition parameter set to a user defined date. Something like:

DoCmd.OpenReport "report_name", acViewPreview,,"[Name of the field] = " &
someform.the_date

Alternatively, in the OnOpen event of the report, you could put a Inputbox
and filter on that date. Something like:

myDate = Inputbox("Please enter a date:", "Enter Date", Now())
Me.Filter = "[Name of the field] = " & myDate
Me.FilterOn = True

Hope this helps,
Eric
 
Right now I'm opening the report from the Database window, not from a form.

Thanks

Eric D. said:
Hi,

Depends on how you're opening your report. If you are using a form based
interface to open reports, you could use the Docmd.OpenReport method along
with the wherecondition parameter set to a user defined date. Something like:

DoCmd.OpenReport "report_name", acViewPreview,,"[Name of the field] = " &
someform.the_date

Alternatively, in the OnOpen event of the report, you could put a Inputbox
and filter on that date. Something like:

myDate = Inputbox("Please enter a date:", "Enter Date", Now())
Me.Filter = "[Name of the field] = " & myDate
Me.FilterOn = True

Hope this helps,
Eric

jrtmax said:
I would like a parameter pop-up to appear when a particular report is run.
How do I do that?

For example, I have a report based on a crosstab query. I want the report
to only show the results from the query for a selected date. I want the date
specified when the report is run.

Thanks
 
One way to do this is to put the parameter in the criteria of the query.
The report will call the query and the query will prompt for the parameter
before it previews or prints.

HTH
Scott B


jrtmax said:
Right now I'm opening the report from the Database window, not from a
form.

Thanks

Eric D. said:
Hi,

Depends on how you're opening your report. If you are using a form based
interface to open reports, you could use the Docmd.OpenReport method
along
with the wherecondition parameter set to a user defined date. Something
like:

DoCmd.OpenReport "report_name", acViewPreview,,"[Name of the field] = " &
someform.the_date

Alternatively, in the OnOpen event of the report, you could put a
Inputbox
and filter on that date. Something like:

myDate = Inputbox("Please enter a date:", "Enter Date", Now())
Me.Filter = "[Name of the field] = " & myDate
Me.FilterOn = True

Hope this helps,
Eric

jrtmax said:
I would like a parameter pop-up to appear when a particular report is
run.
How do I do that?

For example, I have a report based on a crosstab query. I want the
report
to only show the results from the query for a selected date. I want
the date
specified when the report is run.

Thanks
 
I've tried what you've recommended already. The underlying query is a
crosstab query. When I declare parameters in this crosstab query and link
the report to it, I can't work with the report at all because I am constantly
interrupted with a parameter pop-up.

Any other solution?

Scott B said:
One way to do this is to put the parameter in the criteria of the query.
The report will call the query and the query will prompt for the parameter
before it previews or prints.

HTH
Scott B


jrtmax said:
Right now I'm opening the report from the Database window, not from a
form.

Thanks

Eric D. said:
Hi,

Depends on how you're opening your report. If you are using a form based
interface to open reports, you could use the Docmd.OpenReport method
along
with the wherecondition parameter set to a user defined date. Something
like:

DoCmd.OpenReport "report_name", acViewPreview,,"[Name of the field] = " &
someform.the_date

Alternatively, in the OnOpen event of the report, you could put a
Inputbox
and filter on that date. Something like:

myDate = Inputbox("Please enter a date:", "Enter Date", Now())
Me.Filter = "[Name of the field] = " & myDate
Me.FilterOn = True

Hope this helps,
Eric

:

I would like a parameter pop-up to appear when a particular report is
run.
How do I do that?

For example, I have a report based on a crosstab query. I want the
report
to only show the results from the query for a selected date. I want
the date
specified when the report is run.

Thanks
 
Hi,
try to run a pre-query with a parameter where you put the date condition.
Then you make a crosstab-query based on the first "normal" query. Then you
should be able to avoid the repeated date-prompt.

Einar

"jrtmax" skrev:
I've tried what you've recommended already. The underlying query is a
crosstab query. When I declare parameters in this crosstab query and link
the report to it, I can't work with the report at all because I am constantly
interrupted with a parameter pop-up.

Any other solution?

Scott B said:
One way to do this is to put the parameter in the criteria of the query.
The report will call the query and the query will prompt for the parameter
before it previews or prints.

HTH
Scott B


jrtmax said:
Right now I'm opening the report from the Database window, not from a
form.

Thanks

:

Hi,

Depends on how you're opening your report. If you are using a form based
interface to open reports, you could use the Docmd.OpenReport method
along
with the wherecondition parameter set to a user defined date. Something
like:

DoCmd.OpenReport "report_name", acViewPreview,,"[Name of the field] = " &
someform.the_date

Alternatively, in the OnOpen event of the report, you could put a
Inputbox
and filter on that date. Something like:

myDate = Inputbox("Please enter a date:", "Enter Date", Now())
Me.Filter = "[Name of the field] = " & myDate
Me.FilterOn = True

Hope this helps,
Eric

:

I would like a parameter pop-up to appear when a particular report is
run.
How do I do that?

For example, I have a report based on a crosstab query. I want the
report
to only show the results from the query for a selected date. I want
the date
specified when the report is run.

Thanks
 
Back
Top