Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a value in a field automatically in Access 2010 table

Status
Not open for further replies.

SalvadorD

Programmer
Apr 8, 2011
7
MX
I have table called Balance with the following fields:
year date,
CAsset double,
CLiabilities Double,
Difference Double

I need to set a value in Difference field automatically by using this operation: CAsset - CLiabilities
 
But also disable the field difference becasue it will be fillied automatically
 

First, you should not use "year" as a field name, because it's a reserved word. CYear would work.

Second, the value you're suggesting for the Difference field is a calculated value. Standard practice is to avoid storing calculated values in tables. They are better obtained by using a query.

Code:
SELECT CAsset - CLiabilities As Difference
FROM myTable


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top