Report gone bad...

G

Guest

I'm sure I've made a mess with this report, but the calculations are tricky.
I'll try to explain what I have done and what I need.

I have a report that is using a query for the record source with a few bound
fields:
[closed date]
[date claim rcvd]
[date report rcvd]
[inside adjuster name]

In the report I have some unbound calculated fields in the detail section of
the inside adjuster name group header:

[date report rcvd2]=IIf(IsNull([Date Report Rcvd]),Date(),[Date Report Rcvd])

[totaldays]=IIf(Not IsNull([closed date]) And [closed date]<[repdue] And
[closed date]<[date report rcvd],'C',IIf(Not IsNull([closed date]) And
[closed date]<[repdue] And IsNull([date report rcvd]),'C',IIf(Not
IsNull([Date Report Not Approved]),'NA',[DateReportRcvd2]-[Date Claim Rcvd])))

[tdaysdisplay]=IIf([TotalDays]='C','--',IIf([totaldays]='NA','--',IIf(IsNull([date report rcvd]) And [totaldays]<45,'N/A',[totaldays])))

[statuscode]=IIf([TotalDays]='C','CLOSED',IIf([totaldays]='NA','NOTAPRV',IIf(IsNull([date
report rcvd]) And [totaldays]>45,'LATE',IIf(IsNull([date report rcvd]) And
[totaldays]<45,'N/A','OK'))))

This all seems to work ok.

My problem is that I need to have a percentage in the report footer that
tells me how many of the reports are Closed and OK. Problem is when I try to
refer to any of the unbound calculated fields I created above, access prompts
me for them when I run the report.

Please help!! And Thanks!!
 
D

Duane Hookom

You can't reference a control name. You must use the expression. For
instance:

[txtTotalCost]=[Qty] * [UnitPrice]

In the report footer, you would need:
=Sum([Qty] * [UnitPrice])
This would not work:
=Sum([txtTotalCost])
 
G

Guest

I realize that, however, it doesn't help me. I don't think I can reference
the expression, given how messy it is. A t least I've tried and nothing works.

Duane Hookom said:
You can't reference a control name. You must use the expression. For
instance:

[txtTotalCost]=[Qty] * [UnitPrice]

In the report footer, you would need:
=Sum([Qty] * [UnitPrice])
This would not work:
=Sum([txtTotalCost])

--
Duane Hookom
MS Access MVP
--

theitman said:
I'm sure I've made a mess with this report, but the calculations are
tricky.
I'll try to explain what I have done and what I need.

I have a report that is using a query for the record source with a few
bound
fields:
[closed date]
[date claim rcvd]
[date report rcvd]
[inside adjuster name]

In the report I have some unbound calculated fields in the detail section
of
the inside adjuster name group header:

[date report rcvd2]=IIf(IsNull([Date Report Rcvd]),Date(),[Date Report
Rcvd])

[totaldays]=IIf(Not IsNull([closed date]) And [closed date]<[repdue] And
[closed date]<[date report rcvd],'C',IIf(Not IsNull([closed date]) And
[closed date]<[repdue] And IsNull([date report rcvd]),'C',IIf(Not
IsNull([Date Report Not Approved]),'NA',[DateReportRcvd2]-[Date Claim
Rcvd])))

[tdaysdisplay]=IIf([TotalDays]='C','--',IIf([totaldays]='NA','--',IIf(IsNull([date
report rcvd]) And [totaldays]<45,'N/A',[totaldays])))

[statuscode]=IIf([TotalDays]='C','CLOSED',IIf([totaldays]='NA','NOTAPRV',IIf(IsNull([date
report rcvd]) And [totaldays]>45,'LATE',IIf(IsNull([date report rcvd]) And
[totaldays]<45,'N/A','OK'))))

This all seems to work ok.

My problem is that I need to have a percentage in the report footer that
tells me how many of the reports are Closed and OK. Problem is when I try
to
refer to any of the unbound calculated fields I created above, access
prompts
me for them when I run the report.

Please help!! And Thanks!!
 
D

Duane Hookom

What do you mean by "nothing works" and what expression did you use?

Reviewing your IIf() function looks like it might return a number or text. I
consider this improper. An IIf() should return a single data type or null.

--
Duane Hookom
MS Access MVP
--

theitman said:
I realize that, however, it doesn't help me. I don't think I can reference
the expression, given how messy it is. A t least I've tried and nothing
works.

Duane Hookom said:
You can't reference a control name. You must use the expression. For
instance:

[txtTotalCost]=[Qty] * [UnitPrice]

In the report footer, you would need:
=Sum([Qty] * [UnitPrice])
This would not work:
=Sum([txtTotalCost])

--
Duane Hookom
MS Access MVP
--

theitman said:
I'm sure I've made a mess with this report, but the calculations are
tricky.
I'll try to explain what I have done and what I need.

I have a report that is using a query for the record source with a few
bound
fields:
[closed date]
[date claim rcvd]
[date report rcvd]
[inside adjuster name]

In the report I have some unbound calculated fields in the detail
section
of
the inside adjuster name group header:

[date report rcvd2]=IIf(IsNull([Date Report Rcvd]),Date(),[Date Report
Rcvd])

[totaldays]=IIf(Not IsNull([closed date]) And [closed date]<[repdue]
And
[closed date]<[date report rcvd],'C',IIf(Not IsNull([closed date]) And
[closed date]<[repdue] And IsNull([date report rcvd]),'C',IIf(Not
IsNull([Date Report Not Approved]),'NA',[DateReportRcvd2]-[Date Claim
Rcvd])))

[tdaysdisplay]=IIf([TotalDays]='C','--',IIf([totaldays]='NA','--',IIf(IsNull([date
report rcvd]) And [totaldays]<45,'N/A',[totaldays])))

[statuscode]=IIf([TotalDays]='C','CLOSED',IIf([totaldays]='NA','NOTAPRV',IIf(IsNull([date
report rcvd]) And [totaldays]>45,'LATE',IIf(IsNull([date report rcvd])
And
[totaldays]<45,'N/A','OK'))))

This all seems to work ok.

My problem is that I need to have a percentage in the report footer
that
tells me how many of the reports are Closed and OK. Problem is when I
try
to
refer to any of the unbound calculated fields I created above, access
prompts
me for them when I run the report.

Please help!! And Thanks!!
 

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