How do I add a sum of a subform on a parent form?



Hi,

I have two forms and tables say [Invoice Header] and [Invoice Lines].
The tables are joined by [Invoice Number]. I must say for some reason (long
story), the invoice header and lines are fed separately but do tie with each
other.
The user can go in the form header and then open the subform with the line
info. I would like to make it that if the user is updating the one of the
line amounts of the invoice line form, that upon closing the subform the
invoice amount on the header is recalculated.

I tried an update query which looks like
UPDATE [Invoice Header] INNER JOIN [Invoice Line] On [Invoice
Header].[Invoice Number] = [Invoice Line].[Invoice Number] SET [Invoice
Header].[Amount] = SELECT SUM ([Invoice Line].[Amount]) FROM [Invoice Line]
GROUP BY [Invoice Line].[Invoice Number]
WHERE [Invoice Line].[Invoice Number] = Form![Invoice Line].[Invoice Number]

and I get an error "Operation must use an updatable query"

Thanks in advance,
Kanga
.



Relevant Pages

  • Re: How do I add a sum of a subform on a parent form?
    ... Kanga, don't store this total in the main form's table. ... > The tables are joined by [Invoice Number]. ... > The user can go in the form header and then open the subform with the line ... > I tried an update query which looks like ...
    (microsoft.public.access.queries)
  • Re: Bound controls in Page Header section of Access 97 report
    ... Suppose we want to have a page header ... that lists the invoice number for the page as well as the product name. ... control with the product name in the page header. ... it simply select the first record in the set of records on that page to ...
    (microsoft.public.access.reports)
  • Re: How do I add a sum of a subform on a parent form?
    ... > Kanga, don't store this total in the main form's table. ... >> The user can go in the form header and then open the subform with the line ... >> line amounts of the invoice line form, that upon closing the subform the ... >> invoice amount on the header is recalculated. ...
    (microsoft.public.access.queries)
  • Re: Problem with naming group headers.
    ... The simplest approach would be to create one invoice for each order. ... Invoice header ... Order footer ... To remove the Report Header and Footer, click the item on the View menu. ...
    (microsoft.public.access.reports)
  • Re: SPEED QUESTION
    ... header search and detail presentation. ... Supply criteria to the user to search through all those invoice headers, ... have another section of your form load the invoice details ... >> Dacon Software Consulting ...
    (microsoft.public.dotnet.languages.vb)

Loading