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 = Cell update depending on count of field in another table

Status
Not open for further replies.

rob2k

MIS
May 6, 2003
5
0
0
US
This may be a simple question... :S

How do i make a field in a table update itself depending on the total values of a yes/no (or number) field in another table?

Like in Excel B3 &quot;Sum = (A1:A10) <-- how do i do this sort of cell calculation in access?

I started by look at querys, a query to &quot;count&quot; the values in a field in one table, but then got stuck as there is no way to automatically apply this info.

it cant really be a macro/qry that runs on a command, as it should really update straight away like excel would.
 
the Yes/No values of the table to be counted
If entered in a subForm

Then in Form_afterUpdate
Form_afterInsert

U can have a
NZ(Dcount(&quot;<fieldName&quot;,&quot;<TableName>&quot;,&quot;<Criteria>&quot;),0)

Then fetching that value and update the table1 u require To

I think Form_afterUpdate will come before Form_afterInsert
InCase of Adding a New Record For Bound Form.
So i ask u to do in case of NewRecord Boolean Set at
Form_AfterInsert

And For Old Records at Form_afterUpdate



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top