Auto Subtracting number fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

Please can you help?

I have a Number field for 'Received', one for 'Issued' and one for 'Balance'
in a table.

Is there anyway the 'Balance' field can automatically update, so it takes
the amount in 'Received' and subtracts 'Issued'.

I am not an expert on access but sort of know my way around. If there is a
way can you tell me how t write it and where, either in the table or the form.

Thank you very much

Alec
 
You shouldn't store calculated field, you can get the same resault using a
query

In SQL:

Select Received , Issued , [Received] - [Issued] As Balance From TableName

In Query design it will look like
Balance : [Received] - [Issued]

Also, in the form you can create another text box and write in it
=[Received] - [Issued]

The resault will always correct and up to date.

Updating this field automatically can be done using a form, but if the felds
will be updated directly in the table, the caculated field won't be updated.
So, use a query to retrive the calculated field
 
BS"D

Thank you very much - looks so much better now.

Alec

Ofer Cohen said:
You shouldn't store calculated field, you can get the same resault using a
query

In SQL:

Select Received , Issued , [Received] - [Issued] As Balance From TableName

In Query design it will look like
Balance : [Received] - [Issued]

Also, in the form you can create another text box and write in it
=[Received] - [Issued]

The resault will always correct and up to date.

Updating this field automatically can be done using a form, but if the felds
will be updated directly in the table, the caculated field won't be updated.
So, use a query to retrive the calculated field

--
Good Luck
BS"D


Alec said:
Hi All,

Please can you help?

I have a Number field for 'Received', one for 'Issued' and one for 'Balance'
in a table.

Is there anyway the 'Balance' field can automatically update, so it takes
the amount in 'Received' and subtracts 'Issued'.

I am not an expert on access but sort of know my way around. If there is a
way can you tell me how t write it and where, either in the table or the form.

Thank you very much

Alec
 
Back
Top