subtracting a figure from the same column

  • Thread starter Thread starter guidop12
  • Start date Start date
G

guidop12

I'm trying to subtract two figures from the same column (ex: a figure from
line 11 column B - a figure from line 10 column B) and then put the total in
a field on a form. Can someone help me with the expression I need to put in
the event for that field. I'm thinking it should go in the OnCLick property
 
is this data in Access? ... you are using Excel terminology to describe
it...

if it is in Access, what is the fieldname? What is the primary key
field of the table? What is the logic for determining the previous
record? -- do you have a sequential field?

Access does not have anything analogous to ROW in Excel -- records
cannot be referenced by a "record number" as that changes depending on
how the data is sorted and is not something that can be addressed


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*
 
Yes this is in access. My primary key is ID. What I want to do is in a form I
have
Read date (user will input)
Black Click (user will input)
Black Total (formula: current Black Click - previous record Black Click)

I want the Black total field to populate when the field in clicked

Is this possible??
 
do you have a sequential field? A method is needed to programmitally
determine WHICH record to get... is it the [Read Date] what you would be
using to determine the previous record?

Do you have a field in the table that categorizes a record? or do all
records correlate to the same thing?

What kind of information is this?


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*
 
My table is set up like this

ID(sequential field) Read_Date Black_Click Black_Total_Month
1 05/05/08 505957 505957
2 06/02/08 762429 256472 (this number is
#2 black click - #1 black click , which was originally an Excel formula)

Do I need some other field to do the math?

So again I want my form to pick up the Black_Total_month field
automatically

strive4peace said:
do you have a sequential field? A method is needed to programmitally
determine WHICH record to get... is it the [Read Date] what you would be
using to determine the previous record?

Do you have a field in the table that categorizes a record? or do all
records correlate to the same thing?

What kind of information is this?


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*



Yes this is in access. My primary key is ID. What I want to do is in a form I
have
Read date (user will input)
Black Click (user will input)
Black Total (formula: current Black Click - previous record Black Click)

I want the Black total field to populate when the field in clicked

Is this possible??
 
Hi Guido (is that your name?)

What kind of information is this?

As a general rule, it is not a good idea to store calculated fields

if you want to display a total for the current month, you can set this
to be the ControlSource of a textbox control:

=nz(dSum("[Fieldname]","[Tablename]","Year([DateField])=" &
Year(me.Date_controlname)),0)

WHERE
Fieldname is the name of your field
Tablename is the name of your table
DateField is the name of your date field

realize that, until you save the record, it will not be included in the
total

you can use this same analogy to show other totals


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*



My table is set up like this

ID(sequential field) Read_Date Black_Click Black_Total_Month
1 05/05/08 505957 505957
2 06/02/08 762429 256472 (this number is
#2 black click - #1 black click , which was originally an Excel formula)

Do I need some other field to do the math?

So again I want my form to pick up the Black_Total_month field
automatically

strive4peace said:
do you have a sequential field? A method is needed to programmitally
determine WHICH record to get... is it the [Read Date] what you would be
using to determine the previous record?

Do you have a field in the table that categorizes a record? or do all
records correlate to the same thing?

What kind of information is this?


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*



Yes this is in access. My primary key is ID. What I want to do is in a form I
have
Read date (user will input)
Black Click (user will input)
Black Total (formula: current Black Click - previous record Black Click)

I want the Black total field to populate when the field in clicked

Is this possible??

:

is this data in Access? ... you are using Excel terminology to describe
it...

if it is in Access, what is the fieldname? What is the primary key
field of the table? What is the logic for determining the previous
record? -- do you have a sequential field?

Access does not have anything analogous to ROW in Excel -- records
cannot be referenced by a "record number" as that changes depending on
how the data is sorted and is not something that can be addressed


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*




guidop12 wrote:
I'm trying to subtract two figures from the same column (ex: a figure from
line 11 column B - a figure from line 10 column B) and then put the total in
a field on a form. Can someone help me with the expression I need to put in
the event for that field. I'm thinking it should go in the OnCLick property
 
Back
Top