Need help with a date field in a report

B

BobV

Group:

I have a report with several calculated unbound textboxes that have formulas
in the Control Source. I need to use the company's beginning of the year
date in some of the unbound textboxes that are located in the Detail section
of the report. The problem is that the beginning of the year date is in a
label that is located in the header of the report, and I can't figure out
how to use it in a formula in an unbound textbox located in the Detail
section.

I want to use the beginning of the year date in an unbound textbox (located
in the Detail section) that has a Control Source with the formula:

=IIF(AcqDate>BegOfYrDate, [intDepreciationAmount],0)

However, when I print the report, the word #Error# prints. How do I convert
the label that is located in the report header into a date that I can use in
formulas in the unbound textboxes on the report?

Thanks,
Bob
 
S

Steve Schapel

Bob,

You can't. You can't use the text of a label caption as if it is data.
You will either have to "hardcode" the beginning of year date into the
expression, for example...
=IIf([AcqDate]>#1-07-04#,[intDepreciationAmount],0)
Or you will need to have it entered in a table somewhere, which you
include in the query which is the recordsource of the report, so that
you can then refer to this field in the expression.
 
B

BobV

Steve:

Thanks for your help. I will have to join two tables in my query that the
report is based on.

Bob V


Steve Schapel said:
Bob,

You can't. You can't use the text of a label caption as if it is data.
You will either have to "hardcode" the beginning of year date into the
expression, for example...
=IIf([AcqDate]>#1-07-04#,[intDepreciationAmount],0)
Or you will need to have it entered in a table somewhere, which you
include in the query which is the recordsource of the report, so that
you can then refer to this field in the expression.

--
Steve Schapel, Microsoft Access MVP

Group:

I have a report with several calculated unbound textboxes that have formulas
in the Control Source. I need to use the company's beginning of the year
date in some of the unbound textboxes that are located in the Detail section
of the report. The problem is that the beginning of the year date is in a
label that is located in the header of the report, and I can't figure out
how to use it in a formula in an unbound textbox located in the Detail
section.

I want to use the beginning of the year date in an unbound textbox (located
in the Detail section) that has a Control Source with the formula:

=IIF(AcqDate>BegOfYrDate, [intDepreciationAmount],0)

However, when I print the report, the word #Error# prints. How do I convert
the label that is located in the report header into a date that I can use in
formulas in the unbound textboxes on the report?

Thanks,
Bob
 
Top