Re: Calculating fields within a SubForm for each record

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



JNLSeb wrote:

When a SubForm is loading currently a calculation is being done for each
record but the values are based only on the first. So, if the subform has 20
records, the value of this "special" field is being populated for all 20
fields but the value is done based only on the first and not each individual
record.

Where should the code be place to have it calculated for each record on the
subform?


Either in the report text box's control source expression or
as a calculated field in the (sub)form's record source
query.

--
Marsh
MVP [MS Access]
.



Relevant Pages

  • Re: Textbox giving an #Error message
    ... In your subform footer, you can't sum a "calculated" unbound control. ... Place LineTotal field in your sub records instead of your previous calculated field. ... willl yield the sum all indiviodual LineTotals. ...
    (microsoft.public.access.formscoding)
  • Re: Referencing a calculated field in a form from a subform
    ... number, employee number, as well as a field called "Total OLP Days allowed". ... This is a calculated field with VBA code behind it. ... Then there is a subform that lists the time taken. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error "Field can not be updated" when entering data in a subfo
    ... In this query I have added a calculated field. ... subform on only one table if you plan to change data. ... not) or that I am trying to change a value of a locked control (no controls ...
    (microsoft.public.access.forms)
  • Need check box to change formula used in subform source
    ... I have a subform for listing parts. ... NET PRICE, LIST PRICE, Quantity, Supplier, and a calculated field called Part ... hidden text box on my subform that calculates the sum of all the Part Totals ...
    (comp.databases.ms-access)
  • Check box changes formula used in subform
    ... I have a subform for listing parts. ... NET PRICE, LIST PRICE, Quantity, Supplier, and a calculated field called Part ... hidden text box on my subform that calculates the sum of all the Part Totals ...
    (comp.databases.ms-access)