Specity fixed criteria in a reportheader

R

RoBo

I have one more challenge. In a query, I use fixed criteria. I need to print
these criteria in the header of a report but I do not know how to do this.
When the user is prompted for the criteria, I know how to print these
criteria using [Enter date from] e.g. But how can I reference fixed criteria?

Thanks for the help, Ron
 
D

Duane Hookom

If it is "fixed" in the query, just "fix" it in the text box in the report.
 
R

RoBo

Hello Duane,

But what if in some time the fixed criteria change? I should again change it
in the report header. Is it not possible to refernce to a fixed criterion?

Ron

Duane Hookom said:
If it is "fixed" in the query, just "fix" it in the text box in the report.

--
Duane Hookom
MS Access MVP

RoBo said:
I have one more challenge. In a query, I use fixed criteria. I need to
print
these criteria in the header of a report but I do not know how to do this.
When the user is prompted for the criteria, I know how to print these
criteria using [Enter date from] e.g. But how can I reference fixed
criteria?

Thanks for the help, Ron
 
D

Duane Hookom

You could probably write code that would parse the SQL property of your
querydef. For instance, create a new text box and set its control source to:

=Mid(currentdb.querydefs([RecordSource]).[SQL],
InStr(currentdb.querydefs([RecordSource]).[SQL], "Where") +6)

--
Duane Hookom
MS Access MVP

RoBo said:
Hello Duane,

But what if in some time the fixed criteria change? I should again change
it
in the report header. Is it not possible to refernce to a fixed criterion?

Ron

Duane Hookom said:
If it is "fixed" in the query, just "fix" it in the text box in the
report.

--
Duane Hookom
MS Access MVP

RoBo said:
I have one more challenge. In a query, I use fixed criteria. I need to
print
these criteria in the header of a report but I do not know how to do
this.
When the user is prompted for the criteria, I know how to print these
criteria using [Enter date from] e.g. But how can I reference fixed
criteria?

Thanks for the help, Ron
 
R

RoBo

Hi Duane,

When I open the print preview of the report, the report prompt me with an
inputbox asking for the currentdb. What did I do wrong?

Ron

Duane Hookom said:
You could probably write code that would parse the SQL property of your
querydef. For instance, create a new text box and set its control source to:

=Mid(currentdb.querydefs([RecordSource]).[SQL],
InStr(currentdb.querydefs([RecordSource]).[SQL], "Where") +6)

--
Duane Hookom
MS Access MVP

RoBo said:
Hello Duane,

But what if in some time the fixed criteria change? I should again change
it
in the report header. Is it not possible to refernce to a fixed criterion?

Ron

Duane Hookom said:
If it is "fixed" in the query, just "fix" it in the text box in the
report.

--
Duane Hookom
MS Access MVP

I have one more challenge. In a query, I use fixed criteria. I need to
print
these criteria in the header of a report but I do not know how to do
this.
When the user is prompted for the criteria, I know how to print these
criteria using [Enter date from] e.g. But how can I reference fixed
criteria?

Thanks for the help, Ron
 
D

Duane Hookom

Please come back with your exact SQL statement.

--
Duane Hookom
MS Access MVP

RoBo said:
Hi Duane,

When I open the print preview of the report, the report prompt me with an
inputbox asking for the currentdb. What did I do wrong?

Ron

Duane Hookom said:
You could probably write code that would parse the SQL property of your
querydef. For instance, create a new text box and set its control source
to:

=Mid(currentdb.querydefs([RecordSource]).[SQL],
InStr(currentdb.querydefs([RecordSource]).[SQL], "Where") +6)

--
Duane Hookom
MS Access MVP

RoBo said:
Hello Duane,

But what if in some time the fixed criteria change? I should again
change
it
in the report header. Is it not possible to refernce to a fixed
criterion?

Ron

:

If it is "fixed" in the query, just "fix" it in the text box in the
report.

--
Duane Hookom
MS Access MVP

I have one more challenge. In a query, I use fixed criteria. I need
to
print
these criteria in the header of a report but I do not know how to do
this.
When the user is prompted for the criteria, I know how to print
these
criteria using [Enter date from] e.g. But how can I reference fixed
criteria?

Thanks for the help, Ron
 

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