Paramaterized report filter

G

Guest

I have a report with a filter on the report property sheet that looks
something like:

X = [Enter X:]

So, when the report opens (opens or loads?) the user is prompted to "Enter
X:" and everything works fine.

Now, I want to be able to capture and use this value (that the user types
in) in another place on the report. How can I do that? Can I just treat
"[Enter X:]" as a report object with the name [Enter X:] ?

Something tells me that this is more involved. Perhaps I need to get the
value from the user prior to the filter being loaded and then formulate the
user based on the value already obtained.

Any help with this is greatly appreciated. Thanks.

David
 
A

Allen Browne

Yes, you can use [Enter X:] anywhere on your report.

If this parameter is a number or a date (not just text), be sure to declare
the parameter in your query (Parameters on Query menu in query design), so
you can specify the data type.
 
G

Guest

Allen,

Thanks for your help. The parameter is an integer. How does one declare a
parameter in a report filter?

Thanks again.

David
---------
Allen Browne said:
Yes, you can use [Enter X:] anywhere on your report.

If this parameter is a number or a date (not just text), be sure to declare
the parameter in your query (Parameters on Query menu in query design), so
you can specify the data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


I have a report with a filter on the report property sheet that looks
something like:

X = [Enter X:]

So, when the report opens (opens or loads?) the user is prompted to "Enter
X:" and everything works fine.

Now, I want to be able to capture and use this value (that the user types
in) in another place on the report. How can I do that? Can I just treat
"[Enter X:]" as a report object with the name [Enter X:] ?

Something tells me that this is more involved. Perhaps I need to get the
value from the user prior to the filter being loaded and then formulate the
user based on the value already obtained.

Any help with this is greatly appreciated. Thanks.

David
 
A

Allen Browne

What I tend to do is provide a form where the user opens the report.

Place a text box on the form where the user can enter a value. If they enter
something, build a WhereCondition for the OpenReport action. In the report,
you can then refer to:
=[Forms]![MyForm]![MyTextbox]

Set the Format property of the text box to indicate its data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


Allen,

Thanks for your help. The parameter is an integer. How does one declare a
parameter in a report filter?

Thanks again.

David
---------
Allen Browne said:
Yes, you can use [Enter X:] anywhere on your report.

If this parameter is a number or a date (not just text), be sure to declare
the parameter in your query (Parameters on Query menu in query design), so
you can specify the data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


I have a report with a filter on the report property sheet that looks
something like:

X = [Enter X:]

So, when the report opens (opens or loads?) the user is prompted to "Enter
X:" and everything works fine.

Now, I want to be able to capture and use this value (that the user types
in) in another place on the report. How can I do that? Can I just treat
"[Enter X:]" as a report object with the name [Enter X:] ?

Something tells me that this is more involved. Perhaps I need to get the
value from the user prior to the filter being loaded and then
formulate
the
user based on the value already obtained.

Any help with this is greatly appreciated. Thanks.

David
 
G

Guest

Allen,

Thanks very much. Why didn't I think of that! (Just a rhetorical
question).

David
-----------
Allen Browne said:
What I tend to do is provide a form where the user opens the report.

Place a text box on the form where the user can enter a value. If they enter
something, build a WhereCondition for the OpenReport action. In the report,
you can then refer to:
=[Forms]![MyForm]![MyTextbox]

Set the Format property of the text box to indicate its data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


Allen,

Thanks for your help. The parameter is an integer. How does one
declare
a
parameter in a report filter?

Thanks again.

David
---------
Allen Browne said:
Yes, you can use [Enter X:] anywhere on your report.

If this parameter is a number or a date (not just text), be sure to declare
the parameter in your query (Parameters on Query menu in query
design),
so
you can specify the data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


<David> wrote in message I have a report with a filter on the report property sheet that looks
something like:

X = [Enter X:]

So, when the report opens (opens or loads?) the user is prompted to "Enter
X:" and everything works fine.

Now, I want to be able to capture and use this value (that the user types
in) in another place on the report. How can I do that? Can I just treat
"[Enter X:]" as a report object with the name [Enter X:] ?

Something tells me that this is more involved. Perhaps I need to
get
the
value from the user prior to the filter being loaded and then formulate
the
user based on the value already obtained.

Any help with this is greatly appreciated. Thanks.

David
 

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