Very New User Needs Help With Access Expression

D

Denise

=Sum(IIf(Year([DepreciationDate])=2002,
[DepreciationAmount]))

Can someone help me with this expression?

Forms are called "Assets"
On Each form are two buttons - "Maintenance"
& "Depreciation"
Clicking "Depreciation" brings you to a sub-form
where one of the fields is "Total Depreciation" -
this is the total from a table below
entitled "Depreciation Details" which allows you to
enter each amount by date. The table column titles
are "Date" & "Amount"

It appears to me that Access won't reach into this table
because it always asks me for a value for
DepreciationDate. Do I need to create a new field in the
sub-form first?

I'm trying to enter the correct expression in 3 columns of
my summary report.

I want, in 1 column - the prior years accumulated
depreciation - it has to reach into this table and add all
depreciation entries, for that asset, prior to the current
year.

Column 2 should be the current depreciation which would
have to pull just the entry for this year

Column 3 is working fine - the expression I'm using is:
=[DepreciationAmount]. To be honest, I'm not even sure
WHY it's working - I'm that much of a rookie. It's
displaying the total accumulated depreciation for each
asset.

Thanks so much!
 
S

Steve Schapel

Denise,

You mentioned that the field in the table is named Date, and yet your
calculation expression refers to DepreciationDate. Have I missed the
point, or... which one is it?

By the way, the word 'date' has a special meaning in Access (it is caled
a reserved word), and as such it is not a good idea to use it as the
name of a field or control or database object.
 

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